Voice Control Command Generation Method and Terminal

ABSTRACT

A voice control command generation method includes displaying, by a terminal, prompt information in response to a first operation, where the prompt information prompts a user to enter a to-be-recorded operation, receiving, by the terminal, one or more operations from the user, recording, by the terminal in response to a second operation of the one or more operations, operation information corresponding to the one or more operations determining, by the terminal based on a third operation of the one or more operations, first text information corresponding to the operation information, receiving, by the terminal, a first voice command, and performing, by the terminal, a corresponding operation based on the operation information when a text of the first voice command matches the first text information.

TECHNICAL FIELD

Embodiments of this application relate to the field of voice controltechnologies, and in particular, to a voice control command generationmethod and a terminal.

BACKGROUND

A voice assistant is an important application of a terminal (forexample, a mobile phone). The voice assistant may perform intelligentconversation and instant question and answer—based intelligentinteraction with a user. Custom voice control of the voice assistant hasbecome a development trend of the voice assistant.

The custom voice control of the voice assistant means that the voiceassistant may receive a custom command (voice data or text information)entered by the user, and bind the custom command to an operation thatthe user expects to control, by using the custom command, the terminalto perform. In this way, when the voice assistant receives a voicecommand corresponding to the custom command next time, the terminal canautomatically perform an operation bound to the custom command.

Some terminals can provide a custom voice control function of the voiceassistant. However, an operation that can be bound to a custom commandis predefined. To be specific, the user can select an operation thatneeds to be bound to the custom command only from the predefinedoperation. If the operation that the user expects to control, by usingthe custom command, the terminal to perform is not included in theforegoing predefined operation, the voice assistant cannot provide thecustom voice control function. In other words, the terminal cannotimplement personalized custom voice control of the user.

To resolve the foregoing problem, voice assistants of some otherterminals may receive a custom command (for example, “Purchase milk inTaobao”) entered by the user, learn operations (for example, tapping a“Taobao” application icon and entering “Milk” in a search box on a homepage of “Taobao”) corresponding to the custom command of the user in theterminal, and bind the custom command to the operations corresponding tothe custom command of the user. In this way, when the voice assistantreceives a voice command (for example, “Purchase milk in Taobao”)corresponding to the custom command next time, the terminal maysequentially display interfaces for simulating the user to perform theoperations (for example, tapping the “Taobao” application icon andentering “Milk” in the search box on the home page of “Taobao”)corresponding to the custom command. Finally, the terminal may display aresult interface corresponding to the custom command, for example, asearch result interface obtained after the user enters “Milk” in thesearch box on the home page of “Taobao”.

However, although the voice assistant may implement personalized customvoice control of the user by learning the operations corresponding tothe custom command of the user in the terminal, once the voice assistantbinds the custom command to the operations corresponding to the customcommand of the user, the terminal may perform the operationscorresponding to the custom command only when the user speaks the voicecommand (for example, “Purchase milk through Taobao”) corresponding tothe custom command next time word by word. Even if the voice assistantreceives a voice command similar to the voice command corresponding tothe custom command, the terminal does not perform the operationscorresponding to the custom command. Therefore, flexibility of a customvoice control function of the terminal is poor, thereby affecting userexperience.

SUMMARY

Embodiments of this application provide a voice control commandgeneration method and a terminal, to improve flexibility of custom voicecontrol and improve user experience.

According to a first aspect, an embodiment of this application providesa voice control command generation method. The voice control commandgeneration method may include: A terminal displays, in response to afirst operation, prompt information used to prompt a user to enter ato-be-recorded operation. The terminal receives one or more operationsentered by the user. The terminal records, in response to a secondoperation entered by the user, operation information corresponding tothe one or more operations. The terminal determines, based on a thirdoperation entered by the user, first text information corresponding tothe operation information. The terminal receives a first voice command.The terminal performs a corresponding operation based on the operationinformation when a text corresponding to the first voice command matchesthe first text information.

In this embodiment of this application, the terminal may first obtainthe operation information corresponding to the one or more operations,and then determine, based on the third operation of the user, the firsttext information corresponding to the operation information, namely,text information corresponding to the one or more operations. The firsttext information is a command that is selected by the user and thatconforms to a language habit of the user. After the terminal receivesthe first voice command, the terminal may perform the correspondingoperation based on the operation information provided that the text ofthe first voice command matches the first text information, instead ofperforming the corresponding operation only when the user speaks a voicecommand corresponding to the text information word by word. According tothis solution, flexibility of custom voice control can be improved anduser experience can be improved.

With reference to the first aspect, in a possible design manner, thefirst text information includes at least one first part and a secondpart. That the text corresponding to the first voice command matches thefirst text information includes: at least one third part in the textcorresponding to the first voice command is the same as the at least onefirst part, and a location relationship between the at least one thirdpart and a fourth part in the first voice command is the same as alocation relationship between the at least one first part and the secondpart in the first text information.

The operation information includes a first application identifier, afirst interface identifier, a first search word, and operationindication information. The first application identifier is anidentifier of an operation object application corresponding to the oneor more operations, the first interface identifier is an identifier ofan operation object interface corresponding to the one or moreoperations, and the operation indication information is used to indicatean operation performed in the operation object interface through the oneor more operations.

It may be understood that the at least one first part includes the firstapplication identifier and/or the first interface identifier, and thesecond part includes the first search word. In other words, the firstvoice command matches the first text information when the third part inthe first voice command is the first application identifier and/or thefirst interface identifier, and the location relationship between thefourth part and the third part in the first voice command is the same asthe location relationship between the first part and the second part inthe first text information.

With reference to the first aspect, in another possible design manner,the method in which the terminal displays the prompt information inresponse to the first operation may include: The terminal displays theprompt information in a first interface of a voice assistant in responseto the first operation. The first operation may be a tap operation (forexample, a single tap operation) performed by the user on an “Adding acustom command” option in a “Custom voice control” interface in a“Settings” application of the terminal. Alternatively, the firstoperation may be entering a preset voice command by the user in a voicecontrol interface of the voice assistant. For example, the preset voicecommand may be “Follow me”. The first interface of the voice assistantmay be an “Adding a custom command” interface that is in the voiceassistant and that is used to add a custom command.

The method in which the terminal receives the one or more operationsentered by the user may include: The terminal displays a secondinterface in response to a fourth operation performed the user in thefirst interface. The terminal receives the one or more operationsentered by the user in the second interface. The second interface isused by the user to enter the one or more operations. For example, thefourth operation may be a second preset gesture entered by the user inthe first interface, for example, any gesture such as a tick “√”gesture, a slide-up gesture, a slide-down gesture, or a circulargesture. Alternatively, the first interface includes a “Start learning”button used to trigger the terminal to learn the to-be-recordedoperation. The fourth operation may be a tap operation (for example, asingle tap operation) performed by the user on the “Start learning”button in the first interface.

With reference to the first aspect, in another possible design manner,before the terminal determines, based on the third operation entered bythe user, the text information corresponding to the operationinformation, the method in this embodiment of this application furtherincludes: The terminal displays a third interface in response to thesecond operation. The third interface includes at least two pieces oftext information, and the at least two pieces of text information are astatement formed by connecting the first application identifier and/orthe first interface identifier and the first search word based on apreset location relationship by using a connection word. That theterminal determines, based on a third operation entered by the user,text information corresponding to the operation information includes:The terminal receives the third operation performed by the user on thefirst text information in the at least two pieces of text information inthe third interface. The terminal determines, in response to the thirdoperation, the first text information as the text informationcorresponding to the operation information. The third operation is usedto select the first text information from the at least two pieces oftext information.

After obtaining the operation information corresponding to the one ormore operations, the terminal connects the first application identifierand/or the first interface identifier and the first search word based onthe preset location relationship by using the connection word to formthe statement, so as to obtain a plurality of pieces of textinformation, and displays the third interface including the plurality ofpieces of text information, so that the user selects, from the pluralityof pieces of text information, the first text information that conformsto a language habit of the user.

The first text information is a command that is selected by the user andthat conforms to the language habit of the user. Therefore, after theterminal receives the first voice command, the terminal may perform thecorresponding operation based on the operation information provided thatthe text of the first voice command matches the first text information,instead of performing the corresponding operation only when the userspeaks a voice command corresponding to the text information word byword. According to this solution, flexibility of custom voice controlcan be improved and user experience can be improved.

With reference to the first aspect, in another possible design manner,after the terminal determines, in response to the third operation, thefirst text information as the text information corresponding to theoperation information, before the terminal receives the first voicecommand, the method in this embodiment of this application may furtherinclude: The terminal generates a first template text, so that afterreceiving the first voice command, the terminal 100 can more quickly andaccurately identify that the first voice command is a voice command thatmatches the first text information, and then perform the correspondingoperation based on the operation information. The first template text isgenerated by replacing the second part in the first text informationwith type information of the first search word. That the text of thefirst voice command matches the first text information is specifically:the text of the first voice command matches the first template text.That the text of the first voice command matches the first template textincludes: the at least one third part in the text corresponding to thefirst voice command is the same as the at least one first part, thelocation relationship between the at least one third part and the fourthpart in the first voice command is the same as the location relationshipbetween the at least one first part and the second part in the firsttext information, and the fourth part is a word of a type indicated bytype information in the first template text.

The terminal may replace the first search word in the first textinformation with the type information of the first search word, toobtain the first template text. If the terminal 100 receives, next time,a voice command that matches the template text, even if an operationcorresponding to the voice command is not recorded in the terminal, theterminal may also simulate the user to trigger the terminal to performthe operation corresponding to the voice command, and display acorresponding operation interface. In this way, flexibility of customvoice control can be improved and user experience can be improved.

With reference to the first aspect, in another possible design manner,after the terminal generates the first template text, before theterminal receives the first voice command, the method in this embodimentof this application may further include: The terminal displays a fourthinterface, where the fourth interface is used to prompt the user tosend, through the voice assistant, the first voice command that matchesthe first template text, to trigger the terminal to perform acorresponding operation. Optionally, the fourth interface may furtherinclude a statement instance of the first template text. For example,the statement instance of the first template text “Purchase ** throughTaobao” may include “Purchase a pen through Taobao” and “Purchase milkthrough Taobao”. The fourth interface may be used to prompt the user touse a voice command that matches the first template text to trigger theterminal to perform a corresponding operation, so that the user cansend, through the voice assistant, the voice command indicated by thefourth interface, to trigger the terminal to perform the correspondingoperation.

With reference to the first aspect, in another possible design manner,considering that the user may have different names (or statements) for asame object, before displaying the fourth interface, the terminal mayfurther display a fifth interface including an alias input box. Thealias input box is used to receive second text information. The secondtext information is an alias created by the user for the first textinformation. In this way, the user may create the alias for the firsttext information in the alias input box.

Optionally, the fifth interface may further include prompt informationused to indicate the user to enter the second text information in thealias input box. For example, the fifth interface further includesprompt information “Tip: You may enter an alias for the foregoingcommand in the alias input box”.

Some users do not enter the second text information in the alias inputbox in the fifth interface. In other words, the user does not create analias for the first text information. In this case, the terminalreceives a fifth operation performed by the user in the fifth interface.The terminal may directly display the fourth interface in response tothe fifth operation.

Some other users enter the second text information in the alias inputbox in the fifth interface, to create an alias for the first textinformation. In this case, after the terminal displays the fifthinterface, the terminal may receive the second text information enteredby the user in the alias input box, and display the second textinformation in the alias input box. Correspondingly, the terminal maystore the second text information and a correspondence between thesecond text information and the operation information in response to thefifth operation performed by the user in the fifth interface. In thisway, after receiving a second voice command whose text is the same asthe second text information, the terminal may perform, based on theoperation information corresponding to the second text information, anoperation corresponding to the operation information. Optionally, thefourth interface displayed by the terminal further includes the secondtext information.

With reference to the first aspect, in another possible design manner,the terminal may further receive a second voice command entered by theuser through the voice assistant; and when a text of the second voicecommand is the same as the second text information, the terminalperforms, based on the correspondence between the second textinformation and the operation information, an operation corresponding tothe operation information.

In this embodiment of this application, the terminal may further providea service of the alias (namely, the second text information) created bythe user for the first text information. In addition, when receiving thesecond text information, the voice assistant of the terminal may alsosimulate the user to trigger the terminal to perform an operationcorresponding to the second voice command, and display a correspondingoperation interface. In this way, flexibility of custom voice controlcan be improved and user experience can be improved.

According to a second aspect, an embodiment of this application providesa terminal. The terminal includes a display unit, an input unit, arecording unit, a determining unit, and an execution unit. The displayunit is configured to display prompt information in response to a firstoperation, where the prompt information is used to prompt a user toenter a to-be-recorded operation. The input unit is configured to:receive one or more operations entered by the user; and receive a secondoperation entered by the user. The recording unit is configured torecord, in response to a second operation entered by the user, operationinformation corresponding to the one or more operations. The determiningunit is configured to determine, based on a third operation entered bythe user, first text information corresponding to the operationinformation. The input unit is further configured to receive a firstvoice command. The execution unit is configured to perform, by theterminal, a corresponding operation based on the operation informationwhen a text corresponding to the first voice command received by theinput unit matches the first text information determined by thedetermining unit.

With reference to the second aspect, in a possible design manner, thefirst text information includes at least one first part and a secondpart. That the text corresponding to the first voice command matches thefirst text information includes: at least one third part in the textcorresponding to the first voice command is the same as the at least onefirst part, and a location relationship between the at least one thirdpart and a fourth part in the first voice command is the same as alocation relationship between the at least one first part and the secondpart in the first text information.

With reference to the second aspect, in another possible design manner,the operation information includes a first application identifier, afirst interface identifier, a first search word, and operationindication information; and the first application identifier is anidentifier of an operation object application corresponding to the oneor more operations, the first interface identifier is an identifier ofan operation object interface corresponding to the one or moreoperations, and the operation indication information is used to indicatean operation performed in the operation object interface through the oneor more operations. The at least one first part includes the firstapplication identifier and/or the first interface identifier, and thesecond part includes the first search word.

With reference to the second aspect, in another possible design manner,that the display unit is configured to display prompt information inresponse to a first operation includes: the display unit is configuredto display the prompt information in a first interface of a voiceassistant in response to the first operation. The display unit isfurther configured to display a second interface. The second interfaceis used by the user to enter the one or more operations. That the inputunit is configured to receive one or more operations entered by the userincludes: the input unit is configured to receive the one or moreoperations entered by the user in the second interface displayed by thedisplay unit.

With reference to the second aspect, in another possible design manner,the display unit is further configured to: before the determining unitdetermines, based on the third operation entered by the user, the textinformation corresponding to the operation information, display, by theterminal, a third interface in response to the second operation. Thethird interface includes at least two pieces of text information, andthe at least two pieces of text information are a statement formed byconnecting the first application identifier and/or the first interfaceidentifier and the first search word based on a preset locationrelationship by using a connection word. The input unit is furtherconfigured to receive the third operation performed by the user on thefirst text information in the at least two pieces of text information inthe third interface displayed by the display unit. The third operationis used to select the first text information from the at least twopieces of text information. That the determining unit is configured todetermine, based on a third operation entered by the user, textinformation corresponding to the operation information includes: thedetermining unit is configured to determine, in response to the thirdoperation received by the input unit, the first text information as thetext information corresponding to the operation information.

With reference to the second aspect, in another possible design manner,the terminal may further include a generation unit. The generation unitis configured to: after the determining unit determines the first textinformation as the text information corresponding to the operationinformation, before the input unit receives the first voice command,generate a first template text. The first template text is generated byreplacing the second part in the first text information with typeinformation of the first search word. That the text of the first voicecommand matches the first text information may be specifically: the textof the first voice command matches the first template text. That thetext of the first voice command matches the first template textincludes: the at least one third part in the text corresponding to thefirst voice command is the same as the at least one first part, thelocation relationship between the at least one third part and the fourthpart in the first voice command is the same as the location relationshipbetween the at least one first part and the second part in the firsttext information, and the fourth part is a word of a type indicated bytype information in the first template text.

With reference to the second aspect, in another possible design manner,the display unit is further configured to: after the generation unitgenerates the first template text, before the input unit receives thefirst voice command, display a fourth interface, where the fourthinterface is used to prompt the user to send, through the voiceassistant, the first voice command that matches the first template text,to trigger the terminal to perform a corresponding operation.

With reference to the second aspect, in another possible design, thedisplay unit is further configured to display a fifth interface beforedisplaying the fourth interface. The fifth interface includes an aliasinput box, the alias input box is used to receive second textinformation, and the second text information is an alias created by theuser for the first text information. The input unit is furtherconfigured to: after the display unit displays the fifth interface,before the input unit receives a fifth operation performed by the userin the fifth interface, receive the second text information entered bythe user in the alias input box. The display unit is further configuredto display, in the alias input box, the second text information receivedby the input unit. The input unit is further configured to receive thefifth operation performed by the user in the fifth interface displayedby the display unit, where the fifth operation is used to trigger theterminal to end recording of text information. The display unit isfurther configured to display the fourth interface in response to thefifth operation.

The terminal may further include a storage unit. The storage unit isconfigured to store the second text information and a correspondencebetween the second text information and the operation information inresponse to the fifth operation received by the input unit. The fourthinterface displayed by the display unit further includes the second textinformation.

With reference to the second aspect, in another possible design manner,the input unit is further configured to receive a second voice commandentered by the user through the voice assistant. The execution unit isfurther configured to: when a text of the second voice command receivedby the input unit is the same as the second text information stored inthe storage unit, perform, by the terminal based on the correspondencebetween the second text information and the operation information, anoperation corresponding to the operation information.

According to a third aspect, an embodiment of this application providesa terminal. The terminal includes one or more processors, a memory, anda display. The memory and the display are coupled to the processor. Thedisplay is configured to display an image generated by the processor.The memory is configured to store computer program code and relatedinformation of a voice assistant. The computer program code includes acomputer instruction. When the processor executes the computerinstruction, the processor is configured to: control, in response to afirst operation, the display to display prompt information, where theprompt information is used to prompt a user to enter a to-be-recordedoperation; the processor is further configured to receive one or moreoperations entered by the user; and record, in response to a secondoperation entered by the user, operation information corresponding tothe one or more operations, and store the operation information in thememory; and the processor is further configured to determine, based on athird operation entered by the user, first text informationcorresponding to the operation information; receive a first voicecommand; and perform a corresponding operation based on the operationinformation when a text corresponding to the first voice command matchesthe first text information.

With reference to the third aspect, in a possible design manner, thefirst text information determined by the processor includes at least onefirst part and a second part. The processor is further configured to:when at least one third part in the text corresponding to the firstvoice command is the same as the at least one first part, and a locationrelationship between the at least one third part and a fourth part inthe first voice command is the same as a location relationship betweenthe at least one first part and the second part in the first textinformation, determine that the text corresponding to the first voicecommand matches the first text information.

With reference to the third aspect, in another possible design manner,the operation information recorded by the processor includes a firstapplication identifier, a first interface identifier, a first searchword, and operation indication information; and the first applicationidentifier is an identifier of an operation object applicationcorresponding to the one or more operations, the first interfaceidentifier is an identifier of an operation object interfacecorresponding to the one or more operations, and the operationindication information is used to indicate an operation performed in theoperation object interface through the one or more operations. The atleast one first part includes the first application identifier and/orthe first interface identifier, and the second part includes the firstsearch word.

With reference to the third aspect, in another possible design manner,that the processor is configured to control, in response to a firstoperation, the display to display prompt information includes: theprocessor is configured to control, in response to the first operation,the display to display the prompt information in a first interface ofthe voice assistant. That the processor is configured to receive one ormore operations entered by the user includes: the processor isconfigured to: control, in response to a fourth operation performed bythe user in the first interface displayed by the display, the display todisplay a second interface, where the second interface is used by theuser to enter the one or more operations; and receive the one or moreoperations entered by the user in the second interface displayed by thedisplay.

With reference to the third aspect, in another possible design manner,the processor is further configured to: before determining, based on thethird operation entered by the user, the text information correspondingto the operation information, control, in response to the secondoperation, the display to display a third interface, where the thirdinterface includes at least two pieces of text information, and the atleast two pieces of text information are a statement formed byconnecting the first application identifier and/or the first interfaceidentifier and the first search word based on a preset locationrelationship by using a connection word. That the processor isconfigured to determine, based on a third operation entered by the user,text information corresponding to the operation information includes:the processor is configured to: receive the third operation performed bythe user on the first text information in the at least two pieces oftext information in the third interface displayed by the display; anddetermine, in response to the third operation, the first textinformation as the text information corresponding to the operationinformation. The third operation is used to select the first textinformation from the at least two pieces of text information.

With reference to the third aspect, in another possible design manner,the processor is further configured to: after determining, in responseto the third operation, the first text information as the textinformation corresponding to the operation information, before receivingthe first voice command, generate a first template text, where the firsttemplate text is generated by replacing the second part in the firsttext information with type information of the first search word. Theprocessor is further configured to: when the text of the first voicecommand matches the first template text, determine that the text of thefirst voice command matches the first text information. That the text ofthe first voice command matches the first template text includes: the atleast one third part in the text corresponding to the first voicecommand is the same as the at least one first part, the locationrelationship between the at least one third part and the fourth part inthe first voice command is the same as the location relationship betweenthe at least one first part and the second part in the first textinformation, and the fourth part is a word of a type indicated by typeinformation in the first template text.

With reference to the third aspect, in another possible design manner,the processor is further configured to: after generating the firsttemplate text, before receiving the first voice command, control thedisplay to display a fourth interface, where the fourth interface isused to prompt the user to send, through the voice assistant, the firstvoice command that matches the first template text, to trigger theterminal to perform a corresponding operation.

With reference to the third aspect, in another possible design manner,the processor is further configured to: before controlling the displayto display the fourth interface, control the display to display a fifthinterface, where the fifth interface includes an alias input box, thealias input box is used to receive second text information, and thesecond text information is an alias created by the user for the firsttext information. That the processor is configured to control thedisplay to display a fourth interface includes: the processor isconfigured to receive a fifth operation performed by the user in thefifth interface displayed by the display, where the fifth operation isused to trigger the terminal to end recording of text information; andcontrol, in response to the fifth operation, the display to display thefourth interface; and the processor is further configured to store thesecond text information and a correspondence between the second textinformation and the operation information in the memory in response tothe fifth operation. The fourth interface displayed by the displayfurther includes the second text information.

With reference to the third aspect, in another possible design manner,the processor is further configured to: receive a second voice commandentered by the user through the voice assistant; and when a text of thesecond voice command is the same as the second text information,perform, based on the correspondence between the second text informationand the operation information, an operation corresponding to theoperation information.

According to a fourth aspect, an embodiment of this application providesa computer storage medium. The computer storage medium includes acomputer instruction, and when the computer instruction is run on aterminal, the terminal is enabled to perform the voice control commandgeneration method according to the first aspect and the possible designmanners of the first aspect.

According to a fifth aspect, an embodiment of this application providesa computer program product. When the computer program product is run ona computer, the computer is enabled to perform the voice control commandgeneration method according to the first aspect and the possible designmanners of the first aspect.

In addition, for technical effects brought by the terminal according toany one of the second aspect or the third aspect and the design mannersof the second aspect or the third aspect, technical effects brought bythe computer storage medium according to the fourth aspect, andtechnical effects brought by the computer program product according tothe fifth aspect, refer to the technical effects brought by the firstaspect and the different design manners of the first aspect. Details arenot described herein again.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic diagram of a hardware structure of a terminalaccording to an embodiment of this application;

FIG. 2 is a flowchart 1 of a voice control command generation methodaccording to an embodiment of this application;

FIG. 3(a), FIG. 3(b), FIG. 3(c), and FIG. 3(d) are a schematic diagram 1of an instance of a display interface of a terminal according to anembodiment of this application;

FIG. 4(a), FIG. 4(b), and FIG. 4(c) are a schematic diagram 2 of aninstance of a display interface of a terminal according to an embodimentof this application;

FIG. 5(a), FIG. 5(b), and FIG. 5(c) are a schematic diagram 3 of aninstance of a display interface of a terminal according to an embodimentof this application;

FIG. 6(a) and FIG. 6(b) are a schematic diagram 4 of an instance of adisplay interface of a terminal according to an embodiment of thisapplication;

FIG. 7(a) and FIG. 7(b) are a schematic diagram 5 of an instance of adisplay interface of a terminal according to an embodiment of thisapplication;

FIG. 8(a), FIG. 8(b), FIG. 8(c), and FIG. 8(d) are a schematic diagram 6of an instance of a display interface of a terminal according to anembodiment of this application;

FIG. 9 is a flowchart 2 of a voice control command generation methodaccording to an embodiment of this application;

FIG. 10(a), FIG. 10(b), and FIG. 10(c) are a schematic diagram 7 of aninstance of a display interface of a terminal according to an embodimentof this application;

FIG. 11(a), FIG. 11(b), and FIG. 11(c) are a schematic diagram 8 of aninstance of a display interface of a terminal according to an embodimentof this application;

FIG. 12(a), FIG. 12(b), FIG. 12(c), and FIG. 12(d) are a schematicdiagram 9 of an instance of a display interface of a terminal accordingto an embodiment of this application;

FIG. 13(a), FIG. 13(b), FIG. 13(c), and FIG. 13(d) are a schematicdiagram 10 of an instance of a display interface of a terminal accordingto an embodiment of this application;

FIG. 14 is a schematic structural composition diagram 1 of a terminalaccording to an embodiment of this application; and

FIG. 15 is a schematic structural composition diagram 2 of a terminalaccording to an embodiment of this application.

DESCRIPTION OF EMBODIMENTS

To resolve a problem that flexibility of custom voice control isrelatively poor because a terminal cannot perform voice generalizationon a voice command sent by a user, the embodiments of this applicationprovide a voice control command generation method. The voice controlcommand generation method may be applied to a process in which theterminal records, through a voice assistant, a custom command and anoperation corresponding to the custom voice command.

The terminal in the embodiments of this application may be a portablecomputer (for example, a mobile phone), a notebook computer, a personalcomputer (Personal Computer, PC), a wearable electronic device (forexample, a smartwatch), a tablet computer, an augmented reality(augmented reality, AR) device/a virtual reality (virtual reality, VR)device, a vehicle-mounted computer, or the like. A specific form of theterminal is not specially limited in the following embodiments.

FIG. 1 is a structural block diagram of a terminal 100 according to anembodiment of this application. The terminal 100 may include a processor110, an external memory interface 120, an internal memory 121, auniversal serial bus (Universal Serial Bus, USB) interface 130, acharging management module 140, a power management module 141, a battery142, an antenna 1, an antenna 2, a radio frequency module 150, acommunications module 160, an audio module 170, a speaker 170A, areceiver 170B, a microphone 170C, a headset jack 170D, a sensor module180, a button 190, a motor 191, an indicator 192, a camera 193, adisplay screen 194, a subscriber identification module (SubscriberIdentification Module, SIM) card interface 195, and the like. The sensormodule 180 may include a pressure sensor 180A, a gyro sensor 180B, abarometric pressure sensor 180C, a magnetic sensor 180D, an accelerationsensor 180E, a distance sensor 180F, an optical proximity sensor 180G, afingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K,an ambient light sensor 180L, a bone conduction sensor 180M, and thelike.

A structure shown in this embodiment of this application does notconstitute a limitation on the terminal 100. The terminal 100 mayinclude more or fewer components than those shown in the figure, orcombine some components, or split some components, or have differentcomponent arrangements. The components shown in the figure may beimplemented by hardware, software, or a combination of software andhardware.

The processor 110 may include one or more processing units. For example,the processor 110 may include an application processor (ApplicationProcessor, AP), a modem processor, a graphics processing unit (GraphicsProcessing Unit, GPU), an image signal processor

(Image Signal Processor, ISP), a controller, a memory, a video codec, adigital signal processor (Digital Signal Processor, DSP), a basebandprocessor, and/or a neural-network processing unit (Neural-networkProcessing Unit, NPU). Different processing units may be separatedevices, or may be integrated into one or more processors.

The controller may be a decision maker that directs each component ofthe terminal 100 to coordinate work according to an instruction. Thecontroller is a nerve center and a command center of the terminal 100.The controller generates an operation control signal based on aninstruction operation code and a time sequence signal, to completecontrol of instruction fetching and instruction execution.

A memory may be further disposed in the processor 110 to store aninstruction and data.

In some embodiments, the memory in the processor 110 is a cache, and maystore an instruction or data that is just used or cyclically used by theprocessor 110. If the processor 110 needs to use the instruction or thedata again, the processor 110 may directly invoke the instruction or thedata from the memory. This avoids repeated access and reduces a waitingtime of the processor 110, thereby improving system efficiency.

In some embodiments, the processor 110 may include an interface. Theinterface may include an inter-integrated circuit (Inter-IntegratedCircuit, I2C) interface, an inter-integrated circuit sound(Inter-Integrated Circuit Sound, I2S) interface, a pulse code modulation(Pulse Code Modulation, PCM) interface, a universal asynchronousreceiver/transmitter (Universal Asynchronous Receiver/Transmitter, UART)interface, a mobile industry processor interface (Mobile IndustryProcessor Interface, MIPI), a general-purpose input/output(General-Purpose Input/output, GPIO) interface, a SIM interface, a USBinterface, and/or the like.

The I2C interface is a two-way synchronization serial bus, and includesa serial data line (Serial Data Line, SDA) and a serial clock line(Derail Clock Line, SCL). In some embodiments, the processor 110 mayinclude a plurality of groups of I2C buses. The processor 110 may beseparately coupled to the touch sensor 180K, a charger, a flash, thecamera 193, and the like through different I2C bus interfaces. Forexample, the processor 110 may be coupled to the touch sensor 180Kthrough the I2C interface, so that the processor 110 communicates withthe touch sensor 180K through the I2C bus interface, to implement atouch function of the terminal 100.

The I2S interface may be used for audio communication. In someembodiments, the processor 110 may include a plurality of groups of I2Sbuses. The processor 110 may be coupled to the audio module 170 by usingan I2S bus, to implement communication between the processor 110 and theaudio module 170. In some embodiments, the audio module 170 may transmitan audio signal to the communications module 160 through the I2Sinterface, to implement a function of answering a call by using aBluetooth headset.

The PCM interface may also be configured to: perform audiocommunication, and sample, quantize, and code an analog signal. In someembodiments, the audio module 170 may be coupled to the communicationsmodule 160 through a PCM bus interface. In some embodiments, the audiomodule 170 may also transmit an audio signal to the communicationsmodule 160 through the PCM interface, to implement a function ofanswering a call by using a Bluetooth headset. Both the I2S interfaceand the PCM interface may be used for audio communication, and samplingrates of the two interfaces are different.

The UART interface is a universal serial data bus, and is used forasynchronous communication. The bus is a two-way communications bus. Thebus converts to-be-transmitted data between serial communication andparallel communication. In some embodiments, the UART interface isusually configured to connect the processor 110 and the communicationsmodule 160. For example, the processor 110 communicates with a Bluetoothmodule through the UART interface, to implement a Bluetooth function. Insome embodiments, the audio module 170 may transmit an audio signal tothe communications module 160 through the UART interface, to implement afunction of playing music by using a Bluetooth headset.

The MIPI interface may be configured to connect the processor 110 and aperipheral device such as the display screen 194 or the camera 193. TheMIPI interface includes a camera serial interface (Camera SerialInterface, CSI), a display serial interface (Display Serial Interface,DSI), and the like. In some embodiments, the processor 110 communicateswith the camera 193 through the CSI interface, to implement aphotographing function of the terminal 100. The processor 110communicates with the display screen 194 through the DSI interface, toimplement a display function of the terminal 100.

The GPIO interface may be configured by using software. The GPIOinterface may be configured as a control signal, or may be configured asa data signal. In some embodiments, the GPIO interface may be configuredto connect the processor 110 and the camera 193, the display screen 194,the communications module 160, the audio module 170, the sensor module180, or the like. The GPIO interface may alternatively be configured asan I2C interface, an I2S interface, a UART interface, an MIPI interface,or the like.

The USB interface 130 may be a mini USB interface, a micro USBinterface, a USB Type-C interface, or the like. The USB interface 130may be configured to connect to the charger to charge the terminal 100,or may be configured to transmit data between the terminal 100 and aperipheral device, or may be configured to connect to a headset to playaudio by using the headset. The USB interface 130 may alternatively beconfigured to connect to another electronic device, for example, an ARdevice.

An interface connection relationship between the modules shown in thisembodiment of this application is merely an example for description, anddoes not constitute a limitation on the structure of the terminal 100.The terminal 100 may use different interface connection manners or acombination of a plurality of interface connection manners in thisembodiment of this application.

The charging management module 140 is configured to receive a charginginput from a charger. The charger may be a wireless charger, or may be awired charger. In some embodiments of wired charging, the chargingmanagement module 140 may receive a charging input from the wiredcharger through the USB interface 130. In some embodiments of wirelesscharging, the charging management module 140 may receive a wirelesscharging input by using a wireless charging coil of the terminal 100.The charging management module 140 may further supply power to theterminal 100 by using the power management module 141 while charging thebattery 142.

The power management module 141 is configured to connect to the battery142, the charging management module 140, and the processor 110. Thepower management module 141 receives an input from the battery 142and/or the charging management module 140, and supplies power to theprocessor 110, the internal memory 121, the external memory interface120, the display screen 194, the camera 193, the communications module160, and the like. The power management module 141 may be furtherconfigured to monitor parameters such as a battery capacity, a batterycycle count, and a battery health status (electric leakage orimpedance). In some embodiments, the power management module 141 mayalternatively be disposed in the processor 110. In some embodiments, thepower management module 141 and the charging management module 140 mayalternatively be disposed in a same device.

A wireless communication function of the terminal 100 may be implementedby using the antenna 1, the antenna 2, the radio frequency module 150,the communications module 160, a modem, the baseband processor, and thelike.

The antenna 1 and the antenna 2 are configured to: transmit and receiveelectromagnetic wave signals. Each antenna in the terminal 100 may beconfigured to cover one or more communications frequency bands.Different antennas may be further multiplexed to improve antennautilization. For example, a cellular network antenna may be multiplexedas a wireless local area network diversity antenna. In some embodiments,an antenna may be used in combination with a tuning switch.

The radio frequency module 150 may provide a communications processormodule that is applied to the terminal 100 and that includes a wirelesscommunication solution such as 2G/3G/4G/5G. The radio frequency module150 may include at least one filter, a switch, a power amplifier, a lownoise amplifier (Low Noise Amplifier, LNA), and the like. The radiofrequency module 150 receives an electromagnetic wave by using theantenna 1, performs processing such as filtering or amplification on thereceived electromagnetic wave, and transfer the electromagnetic wave tothe modem for demodulation. The radio frequency module 150 may furtheramplify a signal modulated by the modem, and convert the signal into anelectromagnetic wave for radiation by using the antenna 1. In someembodiments, at least some function modules in the radio frequencymodule 150 may be disposed in the processor 110. In some embodiments, atleast some function modules in the radio frequency module 150 may bedisposed in a same device as at least some modules in the processor 110.

The modem may include a modulator and a demodulator. The modulator isconfigured to modulate a to-be-sent low-frequency baseband signal intoan intermediate-high frequency signal. The demodulator is configured todemodulate a received electromagnetic wave signal into a low-frequencybaseband signal. Then, the demodulator transmits the low-frequencybaseband signal obtained through demodulation to the baseband processorfor processing. The low-frequency baseband signal is processed by thebaseband processor, and then transmitted to the application processor.The application processor outputs a sound signal by using an audiodevice (which is not limited to the speaker 170A, the receiver 170B, orthe like), or displays an image or a video by using the display screen194. In some embodiments, the modem may be an independent device. Insome embodiments, the modem may be independent of the processor 110, andis disposed in a same device as the radio frequency module 150 oranother function module.

The communications module 160 may provide a communications processormodule that is applied to the terminal 100 and that includes a wirelesscommunication solution such as a wireless local area network (WirelessLocal Area Networks, WLAN) (for example, a wireless fidelity (WirelessFidelity, Wi-Fi) network), Bluetooth (BlueTooth, BT), a globalnavigation satellite system (Global Navigation Satellite System, GNSS),frequency modulation (Frequency

Modulation, FM), a near field communication (Near Field Communication,NFC) technology, or an infrared (Infrared, IR) technology. Thecommunications module 160 may be one or more devices integrating atleast one communications processor module. The communications module 160receives an electromagnetic wave by using the antenna 2, performsfrequency modulation and filtering processing on an electromagnetic wavesignal, and sends a processed signal to the processor 110. Thecommunications module 160 may further receive a to-be-sent signal fromthe processor 110, perform frequency modulation and amplification on thesignal, and convert the signal into an electromagnetic wave forradiation by using the antenna 2.

In some embodiments, the antenna 1 and the radio frequency module 150 inthe terminal 100 are coupled, and the antenna 2 and the communicationsmodule 160 in the terminal 100 are coupled, so that the terminal 100 cancommunicate with a network and another device by using a wirelesscommunications technology. The wireless communications technology mayinclude a global system for mobile communications (Global System ForMobile Communications, GSM), a general packet radio service (GeneralPacket Radio Service, GPRS), code division multiple access (CodeDivision Multiple Access, CDMA), wideband code division multiple access(Wideband Code Division Multiple Access, WCDMA), time-division codedivision multiple access (Time-Division Code Division Multiple Access,TD-SCDMA), long term evolution (Long Term Evolution, LTE), BT, a GNSS, aWLAN, NFC, FM, an IR technology, and/or the like. The GNSS may include aglobal positioning system (Satellite Based Augmentation Systems, SBAS),a global navigation satellite system (Global Navigation SatelliteSystem, GLONASS), a BeiDou navigation satellite system (BeiDouNavigation Satellite System, BDS), a quasi-zenith satellite system(Quasi-Zenith Satellite System, QZSS), and/or a satellite-basedaugmentation system (Satellite Based Augmentation Systems, SBAS).

The terminal 100 implements the display function by using the GPU, thedisplay screen 194, the application processor, and the like. The GPU isa microprocessor for image processing, and is connected to the displayscreen 194 and the application processor. The GPU is configured toperform mathematical and geometric calculation, and is used for graphicsrendering. The processor 110 may include one or moreCPUs that execute aprogram instruction to generate or change display information.

The display screen 194 is configured to display an image, a video, andthe like. The display screen 194 includes a display panel. The displaypanel may be a liquid crystal display (Liquid Crystal Display, LCD), anorganic light-emitting diode (Organic Light-Emitting Diode, OLED), anactive-matrix organic light-emitting diode (Active-Matrix OrganicLight-Emitting Diode, AMOLED), a flexible light-emitting diode (FlexLight-Emitting Diode, FLED), a mini-LED, a micro-LED, a micro-OLED, aquantum dot light-emitting diode (Quantum Dot Light-Emitting Diodes,QLED), or the like. In some embodiments, the terminal 100 may includeone or N display screens 194, where N is a positive integer greater than1.

The terminal 100 can implement the photographing function by using theISP, the camera 193, the video codec, the GPU, the display screen, theapplication processor, and the like.

The ISP is configured to process data fed back by the camera 193. Forexample, during photographing, a shutter is pressed, light istransmitted to a photosensitive element of the camera through a lens, anoptical signal is converted into an electrical signal, and thephotosensitive element of the camera transmits the electrical signal tothe ISP for processing, to convert the electrical signal into a visibleimage. The ISP may further perform algorithm optimization on noise,brightness, and complexion of the image. The ISP may further optimizeparameters such as exposure and color temperature of a photographingscenario. In some embodiments, the ISP may be disposed in the camera193.

The camera 193 is configured to capture a static image or a video. Anoptical image is generated for an object by using the lens, and theoptical image is projected to the photosensitive element. Thephotosensitive element may be a charge coupled device (Charge CoupledDevice, CCD) or a complementary metal-oxide-semiconductor (ComplementaryMetal-Oxide-Semiconductor, CMOS) phototransistor. The photosensitiveelement converts an optical signal into an electrical signal, and thentransmits the electrical signal to the ISP to convert the electricalsignal into a digital image signal. The ISP outputs the digital imagesignal to the DSP for processing. The DSP converts the digital imagesignal into a standard image signal in an RGB format, a YUV format, orthe like. In some embodiments, the terminal 100 may include one or Ncameras 193, where N is a positive integer greater than 1.

The digital signal processor is configured to process a digital signal.In addition to a digital image signal, the digital signal processor mayfurther process another digital signal. For example, when the terminal100 selects a frequency, the digital signal processor is configured toperform Fourier transform on frequency energy and the like.

The video codec is configured to compress or decompress a digital video.The terminal 100 may support one or more video codecs. In this way, theterminal 100 can play or record videos in a plurality of coding formats,for example, moving picture experts group (Moving Picture Experts Group,MPEG)-1, MPEG-2, MPEG-3, and MPEG-4.

The NPU is a neural-network (Neural-Network, NN) computing processor,quickly processes input information by referring to a structure of abiological neural network, for example, by referring to a transfer modebetween human brain neurons, and may further continuously performself-learning. Applications such as intelligent cognition of theterminal 100 may be implemented by using the NPU, for example, imagerecognition, facial recognition, voice recognition, and textunderstanding.

The external memory interface 120 may be configured to connect to anexternal storage card, for example, a micro SD card, to extend a storagecapability of the terminal 100. The external storage card communicateswith the processor 110 through the external memory interface 120, toimplement a data storage function. For example, files such as music anda video are stored in the external storage card.

The internal memory 121 may be configured to store computer executableprogram code, where the executable program code includes an instruction.The processor 110 performs various function applications of the terminal100 and data processing by running the instruction stored in theinternal memory 121. The memory 121 may include a program storage areaand a data storage area. The program storage area may store an operatingsystem, an application required by at least one function (for example, asound playing function or an image playing function), and the like. Thedata storage area may store data (for example, audio data or a phonebook) created during use of the terminal 100, and the like. In addition,the memory 121 may include a high-speed random access memory, and mayfurther include a nonvolatile memory, for example, at least one magneticdisk storage device, a flash storage device, another volatilesolid-state storage device, a universal flash storage (Universal FlashStorage, UFS), or the like.

The terminal 100 can implement an audio function such as music playbackor recording by using the audio module 170, the speaker 170A, thereceiver 170B, the microphone 170C, the headset jack 170D, theapplication processor, and the like.

The audio module 170 is configured to convert digital audio informationinto an analog audio signal for output, and is also configured toconvert an analog audio input into a digital audio signal. The audiomodule 170 may be further configured to encode and decode an audiosignal. In some embodiments, the audio module 170 may be disposed in theprocessor 110, or some function modules of the audio module 170 aredisposed in the processor 110.

The speaker 170A, also referred to as a “horn”, is configured to convertan audio electrical signal into a sound signal. The terminal 100 may beused to listen to music or answer a call in a hands-free mode over thespeaker 170A.

The receiver 170B, also referred to as an “earpiece”, is configured toconvert an audio electrical signal into a sound signal. When a call isanswered or voice information is listened to by using the terminal 100,the receiver 170B may be put close to a human ear to listen to a voice.

The microphone 170C, also referred to as a “mike” or a “microphone”, isconfigured to convert a sound signal into an electrical signal. Whenmaking a call or sending voice information, a user may move a mouthclose to the microphone 170C and make a sound, to input a sound signalinto the microphone 170C. At least one microphone 170C may be disposedin the terminal 100. In some embodiments, two microphones 170C may bedisposed in the terminal 100, to collect a sound signal and furtherimplement a noise reduction function. In some embodiments, three, four,or more microphones 170C may alternatively be disposed in the terminal100, to collect a sound signal, reduce noise, further identify a soundsource, implement a directional recording function, and the like.

The headset jack 170D is configured to connect to a wired headset. Theheadset jack 170D may be a USB interface 130, a 3.5 mm open mobileterminal platform (Open Mobile Terminal Platform, OMTP) standardinterface, or cellular telecommunications industry association of theUSA (Cellular Telecommunications Industry Association of the USA, CTIA)standard interface.

The pressure sensor 180A is configured to sense a pressure signal, andmay convert the pressure signal into an electrical signal. In someembodiments, the pressure sensor 180A may be disposed in the displayscreen 194. There are many types of pressure sensors 180A, for example,a resistive pressure sensor, an inductive pressure sensor, and acapacitive pressure sensor. The capacitive pressure sensor may includeat least two parallel plates that have conductive materials. Capacitancebetween electrodes changes when force is applied to the pressure sensor.The terminal 100 determines pressure intensity based on a change in thecapacitance. When a touch operation is performed on the display screen194, the terminal 100 detects intensity of the touch operation by usingthe pressure sensor 180A. The terminal 100 may further calculate a touchlocation based on a detection signal of the pressure sensor 180A. Insome embodiments, touch operations that are performed at a same touchlocation but have different touch operation intensity may correspond todifferent operation instructions. For example, when a touch operationwhose touch operation strength is less than a first pressure thresholdis performed on a Messages icon, an instruction for viewing an SMSmessage is executed; or when a touch operation whose touch operationstrength is greater than or equal to a first pressure threshold isperformed on a Messages icon, an instruction for creating an SMS messageis executed.

The gyro sensor 180B may be configured to determine a movement postureof the terminal 100. In some embodiments, an angular velocity of theterminal 100 around three axes (namely, axes x, y, and z) may bedetermined by using the gyro sensor 180B. The gyroscope sensor 180B maybe used for image stabilization during photographing. For example, whenthe shutter is pressed, the gyro sensor 180B detects an angle at whichthe terminal 100 jitters, calculates, based on the angle, a distance forwhich a lens module needs to compensate, and allows the lens to cancelthe jitter of the terminal 100 through reverse motion, to implementimage stabilization. The gyroscope sensor 180B may be further used innavigation and motion sensing game scenarios.

The barometric pressure sensor 180C is configured to measure barometricpressure. In some embodiments, the terminal 100 calculates an altitudeby using a value of the barometric pressure measured by the barometricpressure sensor 180C, to assist in positioning and navigation.

The magnetic sensor 180D includes a Hall sensor. The terminal 100 maydetect opening and closing of a flip leather case by using the magneticsensor 180D. In some embodiments, when the terminal 100 is a clamshellphone, the terminal 100 may detect opening and closing of a flip coverby using the magnetic sensor 180D. Further, a feature such as automaticunlocking of the flip cover is set based on a detected opening orclosing state of the leather case or a detected opening or closing stateof the flip cover.

The acceleration sensor 180E may detect values of accelerations invarious directions (usually three axes) of the terminal 100, and maydetect magnitude and a direction of the gravity when the terminal 100 isstill. The acceleration sensor 180E may be further configured toidentify a posture of the terminal, and is applied to an applicationsuch as switching between a landscape mode and a portrait mode or apedometer.

The distance sensor 180F is configured to measure a distance. Theterminal 100 may measure the distance in an infrared or a laser manner.In some embodiments, in a photographing scenario, the terminal 100 maymeasure the distance by using the distance sensor 180F to implementquick focusing.

For example, the optical proximity sensor 180G may include alight-emitting diode (LED) and an optical detector, for example, aphotodiode. The light-emitting diode may be an infrared light-emittingdiode. The light-emitting diode is configured to emit infrared light.The photodiode is configured to detect infrared reflected light from anearby object. When sufficient reflected light is detected, it may bedetermined that there is an object near the terminal 100. Wheninsufficient reflected light is detected, it may be determined thatthere is no object near the terminal 100. The terminal 100 may detect,by using the optical proximity sensor 180G, that the user holds theterminal 100 close to an ear to make a call, to automatically performscreen-off for power saving. The optical proximity sensor 180G may alsobe used for automatic screen locking or unlocking in a leather case modeor a pocket mode.

The ambient light sensor 180L is configured to sense luminance ofambient light. The terminal 100 may adaptively adjust brightness of thedisplay screen based on the sensed ambient light brightness. The ambientlight sensor 180L may also be configured to automatically adjust a whitebalance during photographing. The ambient light sensor 180L may furthercooperate with the optical proximity sensor 180G to detect whether theterminal 100 is in a pocket, to avoid an accidental touch.

The fingerprint sensor 180H is configured to collect a fingerprint. Theterminal 100 may use a feature of the collected fingerprint to implementfingerprint-based unlocking, application lock access, fingerprint-basedphotographing, fingerprint-based call answering, and the like.

The temperature sensor 180J is configured to detect temperature. In someembodiments, the terminal 100 executes a temperature processing policyby using the temperature detected by the temperature sensor 180J. Forexample, when the temperature reported by the temperature sensor 180Jexceeds a threshold, the terminal 100 lowers performance of a processornear the temperature sensor 180J, to reduce power consumption forthermal protection.

The touch sensor 180K is also referred to as a “touch panel”, and may bedisposed on the display screen 194. The touch sensor 180K is configuredto detect a touch operation performed on or near the touch sensor 180K.The touch sensor 180K may transfer the detected touch operation to theapplication processor, to determine a type of the touch event, and toprovide corresponding visual output by using the display screen 194.

The bone conduction sensor 180M may obtain a vibration signal. In someembodiments, the bone conduction sensor 180M may obtain a vibrationsignal of a vibration bone of a human vocal part. The bone conductionsensor 180M may also be in contact with a human pulse, and receive ablood pressure beating signal. In some embodiments, the bone conductionsensor 180M may also be disposed in the headset. The audio module 170may obtain a voice signal through parsing based on the vibration signalthat is of the vibration bone of the vocal part and that is obtained bythe bone conduction sensor 180M, to implement a voice function. Theapplication processor may parse heart rate information based on theblood pressure beating signal obtained by the bone conduction sensor180M, to implement a heart rate detection function.

The button 190 includes a power button, a volume button, and the like.The button 190 may be a mechanical button, or may be a touch button. Theterminal 100 receives an input of the button 190, and generates a buttonsignal input related to a user setting and function control of theterminal 100.

The motor 191 may generate a vibration prompt. The motor 191 may be usedfor an incoming call vibration prompt, or may be used for a touchvibration feedback. For example, touch operations performed on differentapplications (for example, a photographing application and an audioplaying application) may correspond to different vibration feedbackeffects. Touch operations performed on different areas of the displayscreen 194 may also correspond to different vibration feedback effects.Different application scenarios (for example, a time reminder,information receiving, an alarm clock, a game, and the like) may alsocorrespond to different vibration feedback effects. A touch vibrationfeedback effect may be further customized.

The indicator 192 may be an indicator light, and may be configured toindicate a charging status and a power change, or may be configured toindicate a message, a missed call, a notification, and the like.

The SIM card interface 195 is configured to connect to a SIM card. TheSIM card may be inserted into the SIM card interface 195 or detachedfrom the SIM card interface 195, to implement contact with or separationfrom the terminal 100. The terminal 100 may support one or N SIM cardinterfaces, where N is a positive integer greater than 1. The SIM cardinterface 195 may support a nano-SIM card, a micro-SIM card, a SIM card,and the like. A plurality of cards may be simultaneously inserted in asame SIM card interface 195. The plurality of cards may be of a sametype, or may be of different types. The SIM card interface 195 may alsobe compatible with different types of SIM cards. The SIM card interface195 may also be compatible with an external storage card. The terminal100 interacts with a network by using the SIM card, to implementfunctions such as conversation and data communication. In someembodiments, the terminal 100 uses an eSIM, namely, an embedded SIMcard. The eSIM card may be embedded into the terminal 100, and cannot beseparated from the terminal 100.

The wakeup keyword update method provided in the embodiments of thisapplication may be implemented in the terminal 100.

An embodiment of this application provides a voice control commandgeneration method. The terminal 100 may display, in response to a firstoperation, prompt information used to prompt a user to enter ato-be-recorded operation. The terminal 100 receives one or moreoperations entered by the user. The terminal 100 records, in response toa second operation entered by the user, operation informationcorresponding to the one or more operations. The terminal 100determines, based on a third operation entered by the user, first textinformation corresponding to the operation information. The terminal 100receives a first voice command. The terminal 100 performs acorresponding operation based on the operation information when a textof the first voice command matches the first text information.

The operation information may include a first application identifier, afirst interface identifier, a first search word, and operationindication information that correspond to the one or more operations.The first application identifier is an identifier of an operation objectapplication (for example, a first application) of the one or moreoperations. The first interface identifier is an identifier of anoperation object interface corresponding to the one or more operations.The user may perform an operation in different interfaces of the firstapplication. The first interface identifier may include identifiers ofone or more interfaces of the first application on which the one or moreoperations are performed. The operation indication information is usedto indicate an operation performed in the operation object interfacethrough the one or more operations.

After recording the operation information of the one or more operations,the terminal 100 may determine, based on the third operation entered bythe user, the first text information corresponding to the operationinformation. The first text information is text information that isselected by the user by using the third operation and that correspondsto the one or more operations.

In this embodiment of this application, the first text informationincludes at least one first part and a second part. The at least onefirst part includes the first application identifier and/or the firstinterface identifier, and the second part includes the first searchword. The first voice command includes at least one third part and afourth part. That the text of the first voice command matches the firsttext information may be specifically: the at least one third part in thetext corresponding to the first voice command is the same as the atleast one first part, and a location relationship between the at leastone third part and the fourth part in the first voice command is thesame as a location relationship between the at least one first part andthe second part in the first text information.

In other words, when the location relationship between the at least onethird part and the fourth part in the first voice command is the same asthe location relationship between the at least one first part and thesecond part in the first text information, and the at least one thirdpart in the first voice command is completely the same as the at leastone first part (namely, the first application identifier and/or thefirst interface identifier) in the first text information, the terminal100 may determine that the text corresponding to the first voice commandmatches the first text information.

According to the voice control command generation method provided inthis embodiment of this application, the terminal 100 may first obtainthe operation information corresponding to the one or more operations,and then determine, based on the third operation of the user, the firsttext information corresponding to the operation information, namely,text information corresponding to the one or more operations. The firsttext information is a command that is selected by the user and thatconforms to a language habit of the user. After the terminal 100receives the first voice command, the terminal 100 may perform thecorresponding operation based on the operation information provided thatthe text of the first voice command matches the first text information,instead of performing the corresponding operation only when the userspeaks a voice command corresponding to the text information word byword. According to this solution, flexibility of custom voice controlcan be improved and user experience can be improved.

An embodiment of this application provides a voice control commandgeneration method. As shown in FIG. 2, the voice control commandgeneration method may include S201 to S206.

S201: A terminal 100 displays prompt information in a first interface ofa voice assistant in response to a first operation, where the promptinformation is used to prompt a user to enter a to-be-recordedoperation.

The voice assistant may be an application (Application, APP) installedin the terminal 100, or may be a system function integrated in anoperating system of the terminal 100. The voice assistant may be anembedded application (namely, a system application of the terminal) or adownloadable application in the terminal 100. The embedded applicationis an application provided as a part of the terminal 100 (for example, amobile phone). For example, the embedded application may be a “Settings”application, a “Messages” application, a “Camera” application, or thelike. The downloadable application is an application that may provide aninternet protocol multimedia subsystem (Internet Protocol MultimediaSubsystem, IMS) connection of the downloadable application. Thedownloadable application may be an application preinstalled in theterminal or may be a third-party application that may be downloaded bythe user and installed in the terminal. For example, the downloadableapplication may be a “WeChat” application, an “Alipay” application, an“Email” application, or the like.

After being started, the voice assistant may receive a voice command(namely, a voice control command) entered by the user, to trigger theterminal 100 to perform an operation corresponding to the voice command.For example, the terminal 100 is a mobile phone 300 shown in FIG. 3(a),FIG. 3(b), FIG. 3(c), and FIG. 3(d). The voice assistant may be a “Voiceassistant” application in the mobile phone 300. The first interface maybe an interface that is in display interfaces of the voice assistant(for example, a “Voice assistant” application) and that is used to add a“custom command”. In the first interface, the user may trigger theterminal 100 to start to record the to-be-recorded operation.

For example, the terminal 100 is the mobile phone 300 shown in FIG.3(a), FIG. 3(b), FIG. 3(c), and FIG. 3(d), and the voice assistant isthe “Voice assistant” application in the mobile phone 300. The mobilephone 300 may receive a tap operation (for example, a single tapoperation) performed by the user on a “Voice assistant” application icon302 on a home screen 301 of the mobile phone 300. The mobile phone 300may display, in response to the tap operation performed by the user onthe “Voice assistant” application icon 302, a voice control interface303 shown in FIG. 3(b). The voice control interface 303 includes a“Record” button 304 and a “Settings” option 306. The mobile phone 300may receive, in response to a tap operation (for example, a touch andhold operation) performed by the user on the “Record” button 304, avoice command sent by the user, to trigger the mobile phone 300 toperform an operation corresponding to the voice command.

The “Settings” option 306 is used to set various functions andparameters of the “Voice assistant” application. The mobile phone 300may receive a tap operation performed by the user on the “Settings”option 306 in the voice control interface 303. The mobile phone 300 maydisplay, in response to the tap operation performed by the user on the“Settings” option 306, a “Voice assistant” interface 307 shown in FIG.3(d). Optionally, the voice control interface 303 may further includeprompt information 305. The prompt information 305 is used to indicate afrequently-used function of the “Voice assistant” application to theuser.

Optionally, the mobile phone 300 may further receive a tap operation(for example, a single tap operation) performed by the user on a“Settings” application icon. The mobile phone 100 may display, inresponse to the tap operation performed by the user on the “Settings”application icon, a setting interface 310 shown in FIG. 3(c). Thesetting interface 110 may include an “Airplane model” option, a “WLAN”option, a “Bluetooth” option, a “Mobile network” option, a “Voiceassistant” option 311, and the like. For specific functions of the“Airplane model” option, the “WLAN” option, the “Bluetooth” option, andthe “Mobile network” option, refer to specific descriptions in aconventional technology. Details are not described herein in thisembodiment of this application. The mobile phone 300 may receive a tapoperation (for example, a single tap operation) performed by the user onthe “Voice assistant” option 311. The mobile phone 100 may display, inresponse to the tap operation performed by the user on the “Voiceassistant” option 311, the “Voice assistant” interface 307 shown in FIG.3(d).

The “Voice assistant” interface 307 includes a “Voice wakeup” option 308and a “Custom voice control” option 309. The “Voice wakeup” option 308is used to set a wakeup keyword of the mobile phone 300, and the wakeupkeyword is used to wake up the “Voice assistant” application. Whenreceiving voice data that is sent by the user and that matches thewakeup keyword, the mobile phone 300 may display the voice controlinterface 303 shown in FIG. 3(b). The “Custom voice control” option 309is used to set a custom command (namely, text information in thisembodiment of this application). Specifically, the mobile phone 300 maydisplay, in response to a tap operation (for example, a single tapoperation) performed by the user on the “Custom voice control” option309, a “Custom voice control” interface 401 shown in FIG. 4(a).

The “Custom voice control” interface 401 includes: a “Custom voicecontrol” button 402, custom commands (for example, a “Custom command 1”404 and a “Custom command 2” 405) added to the mobile phone 300, an“Adding a custom command” option 406, and the like. The “Custom voicecontrol” button 402 is used to enable a custom voice control function.Only after the custom voice control function is enabled, the mobilephone 300 can perform a corresponding event in response to the “Customcommand 1” 404 or the “Custom command 2” 405. In addition, only afterthe custom voice control function is enabled, the user can trigger, byusing a first preset gesture (for example, an S-shaped gesture), themobile phone 300 to display an “Adding a custom command” interface 407.For example, the “Custom voice control” interface 401 may furtherinclude prompt information 403, for example, “After a function isenabled, a user may trigger, by using an S-shaped gesture, the mobilephone to display an interface used to add a ‘custom command’”.

The first operation may be a tap operation (for example, a single tapoperation) performed by the user on the “Adding a custom command” option406 in the “Custom voice control” interface 401 shown in FIG. 4(a).Alternatively, the first operation may include an operation performed bythe user on the mobile phone 300 shown in FIG. 3(a), FIG. 3(b), FIG.3(c), and FIG. 3(d) and a tap operation performed by the user on the“Adding a custom command” option 406. The mobile phone 300 may display,in response to the tap operation performed by the user on the “Adding acustom command” option 406, the “Adding a custom command” interface 407(namely, the first interface) shown in FIG. 4(b). The first interface isused to prompt the user to enter the to-be-recorded operation. Forexample, the “Adding a custom command” interface 407 includes a “Startlearning” button 408. The “Start learning” button 408 is used to triggerthe mobile phone 300 to learn the to-be-recorded operation. The firstinterface 407 may further include prompt information used to prompt theuser to enter the to-be-recorded operation. For example, the firstinterface 407 may further include prompt information used to prompt theuser to tap the “Start learning” button 408, for example, “Tap thebutton to trigger the mobile phone to learn an operation correspondingto a custom command that you expect to add”.

Optionally, the first operation may alternatively be entering a presetvoice command by the user in the voice control interface 303 shown inFIG. 3(b). For example, the preset voice command may be “Follow me”. Themobile phone 300 may display, in response to receiving the voice command“Follow me” entered by the user in the voice control interface 303, the“Adding a custom command” interface 407 (namely, the first interface)shown in FIG. 4(b).

S202: The terminal 100 displays a second interface in response to afourth operation performed by the user in the first interface, where thesecond interface is used by the user to enter one or more operations.

The fourth operation may be a second preset gesture entered by the userin the first interface, for example, any gesture such as a tick “√”gesture, a slide-up gesture, a slide-down gesture, or a circulargesture. Alternatively, the first interface includes a “Start learning”button used to trigger the terminal 100 to learn the to-be-recordedoperation. The fourth operation may be a tap operation (for example, asingle tap operation) performed by the user on the “Start learning”button in the first interface. For example, the “Adding textinformation” interface 407 includes a “Start learning” button 408. Thefourth operation may be a single tap operation performed by the user onthe “Start learning” button 408.

S203: The terminal 100 records, in response to a second operationentered by the user, operation information corresponding to the one ormore operations.

It may be understood that an operation that needs to be recorded by theterminal 100 may include the one or more operations performed by theuser on the terminal 100. If the terminal 100 needs to record aplurality of operations, the plurality of operations may be operationsperformed by the user in different interfaces. In other words, inresponse to the fourth operation, the second interface displayed by theterminal 100 is a general term for a plurality of interfaces used toreceive the plurality of operations. In this embodiment of thisapplication, the interfaces used to receive the plurality of operationsare respectively referred to as sub-interfaces (for example, a firstsub-interface and a second sub-interface). One or more sub-interfacesused to receive the one or more operations entered by the user may becollectively referred to as the second interface. In this embodiment ofthis application, the one or more operations may be a general term forsub-operations performed by the user in different sub-interfaces (forexample, the first sub-interface and the second sub-interface). Forexample, an operation performed by the user in the first sub-interfaceis referred to as a first sub-operation, and an operation performed bythe user in the second sub-interface is referred to as a secondsub-operation.

Usually, the terminal 100 may first display the first sub-interface inresponse to the fourth operation. The first sub-interface includes ahome screen of the terminal 100 and first prompt information. The homescreen of the terminal 100 includes a home screen icon of the terminal100. The first prompt information is used to prompt the user to tap thehome screen icon to enter an application corresponding to theto-be-recorded operation. For example, the mobile phone 300 may display,in response to the tap operation (namely, the fourth operation)performed by the user on the “Start learning” button 408 shown in FIG.4(b), a first sub-interface 409 shown in FIG. 4(c). The firstsub-interface 409 includes a home screen 411 of the mobile phone 300.The home screen 411 includes home screen icons, for example, an “Email”application icon, a “Camera” application icon, a “Settings” applicationicon, and a “Taobao” application icon. The first sub-interface 409 mayfurther include first prompt information 410, for example, “Tap a homescreen icon to enter an app corresponding to a custom command that youexpect to add”. Pages may be flipped left or right on the home screen411 in the first sub-interface 409 to display another home screen of themobile phone 300. Optionally, the first sub-interface 409 may furtherinclude prompt information 413, for example, “Slide left or right on thehome screen to flip pages”.

Then, the terminal 100 may receive a tap operation (namely, the firstsub-operation, for example, a single tap operation) performed by theuser on any application icon in the first sub-interface. The terminal100 may display the second sub-interface in response to the tapoperation performed by the user on the any application icon. The secondsub-interface includes an application home page (a home page of anapplication corresponding to an application icon tapped by the user) andsecond prompt information. The second prompt information is used toprompt the user to enter, on the application home page, one or moreoperations corresponding to text information. The terminal 100 mayfurther receive the second sub-operation performed by the user in thesecond sub-interface, and display a third sub-interface until theterminal 100 receives the second operation used to trigger the terminal100 to end recording of the one or more operations.

For example, it is assumed that the user taps the “Taobao” applicationicon in the first sub-interface 409. The mobile phone 300 may display,in response to a tap operation (namely, the first sub-operation)performed by the user on the “Taobao” application icon in the firstsub-interface 409, a second sub-interface 501 shown in FIG. 5(a). Thesecond sub-interface 501 includes second prompt information 502 and a“Taobao” home page 503. For example, the second prompt information 502is “Enter an operation corresponding to a custom command in an interfaceof the following third-party application”. As shown in FIG. 5(b), theuser may enter a search word “Milk” in a search box 504 in the secondsub-interface 501. The mobile phone 300 may display, in response to atap operation (for example, a single tap operation) performed by theuser on a search button in the search box 504, a third sub-interface 506shown in FIG. 5(c). The operation of entering the search word “Milk” bythe user in the search box 504 and the tap operation performed by theuser on the search button in the search box 504 may be referred to asthe second sub-operation. The third sub-interface 506 includes thesecond prompt information and a display interface 507 corresponding tothe second sub-operation. The one or more operations may include the tapoperation performed by the user on the “Taobao” application icon in thefirst sub-interface 409, the operation of entering the search word“Milk” in the search box 504 in the second sub-interface 501, and thetap operation performed by the user on the search button in the searchbox 504.

It may be understood that the terminal 100 may obtain, in response tothe operations performed by the user on the sub-interfaces (for example,the first sub-interface and the second sub-interface), the operationinformation corresponding to the one or more operations. The operationinformation includes a first application identifier, a first interfaceidentifier, a first search word, and operation indication informationthat correspond to the one or more operations. The operation indicationinformation is used to indicate an operation performed by the user in acorresponding interface.

For example, the terminal 100 may obtain an application identifier of a“Taobao” application and an interface identifier of the “Taobao” homepage 503 in response to the tap operation performed by the user on the“Taobao” application icon in the first sub-interface 409. The terminal100 may obtain, in response to the operation of entering the search word“Milk” by the user in the search box 504 in the second sub-interface501, operation indication information a used to indicate that the userenters the search word in the search box 504 on the “Taobao” home page503 and the search word “Milk”. The terminal 100 may obtain, in responseto the tap operation performed by the user on the search button in thesearch box 504, operation indication information b used to indicate thatthe user taps the search button in the search box 504 and an interfaceidentifier of the display interface 507 shown in FIG. 5(c).

The application identifier in this embodiment of this application may bea name of an application. For example, the application identifier of the“Taobao” application may be “Taobao”.

The interface identifier (for example, the first interface identifier)in this embodiment of this application may be a name of an interface inan application. The name of the interface may be a name of the interfacein the application by the user, instead of an address link of theinterface. For example, in this embodiment of this application, FIG.12(c) shows an interface 1204 that is in a “Travel” application and thatis used to book a train ticket. In this embodiment of this application,an interface identifier of the interface 1204 used to book the trainticket may be determined as “Train ticket”.

The terminal 100 may display a corresponding interface based on theinterface identifier. Specifically, the terminal 100 may store acorrespondence between an interface identifier of each interface in eachapplication and an address link of a corresponding interface. Theterminal may search, based on the interface identifier, for an addresslink corresponding to the interface identifier, and then display acorresponding interface based on the found address link.

The sub-interfaces (for example, the first sub-interface and the secondsub-interface) each include a button used to trigger the terminal 100 toend recording of the to-be-recorded operation, for example, an endbutton. The second operation may be a tap operation (for example, asingle tap operation, a double tap operation, or a touch and holdoperation) performed by the user on the end button. The terminal 100 mayrecord, in response to a tap operation performed by the user on an endbutton in any sub-interface, the operation information corresponding tothe one or more operations.

For example, the first sub-interface 409 shown in FIG. 4(c) includes anend button 412.

The second sub-interface shown in FIG. 5(a) includes an end button 505.The third sub-interface shown in FIG. 5(b) includes the end button 505.The fourth sub-interface shown in FIG. 5(c) includes the end button 505.For example, the mobile phone 300 may record, in response to a tapoperation performed by the user on the end button 505 in the fourthsub-interface 507 shown in FIG. 5(c), the operation informationcorresponding to the one or more operations.

Alternatively, the third operation may be a third preset gesture enteredby the user in any sub-interface. For example, the third preset gesturemay be any one of an S-shaped gesture, a slide-up gesture, a slide-downgesture, or the like. The terminal 300 may record, in response to thethird preset gesture entered by the user in the any sub-interface, theoperation information corresponding to the one or more operations.

S204: The terminal 100 displays a third interface in response to thesecond operation, where the third interface includes at least two piecesof text information, and the at least two pieces of text information area statement formed by connecting the first application identifier and/orthe first interface identifier and the first search word based on apreset location relationship by using a connection word.

Different connection words correspond to different user statementtemplates. The at least two pieces of text information are obtained byfilling the first application identifier and/or the first interfaceidentifier in a first filling item in the user statement template, andfilling the first search word in a second filling item in the userstatement template. The terminal 100 stores a plurality of userstatement templates. Specifically, the terminal 100 may separatelyconfigure a plurality of user statement templates for different types ofapplications, so that the terminal 100 can, in response to the secondoperation, fill the operation information in a user statement templatecorresponding to an application indicated by the first applicationidentifier, to obtain the at least two pieces of text information.

The plurality of user statement templates are determined by collectingstatistics about a statement habit when the user uses the differenttypes of applications. Applications in this embodiment of thisapplication may include a shopping application, a travel application, avideo application, and the like. For example, the shopping applicationmay include a “Taobao” application, a “Jingdong” application, and thelike. The travel application may include a “Ctrip” application and a“Qunar” application. The video application may include an “iQIYI”application, a “Youku” application, and the like.

The shopping application “Taobao” is used as an example. When using“Taobao” to purchase things (for example, milk), the user usually speaks“Purchase milk in Taobao”, “Purchase milk through Taobao”, “Search formilk in Taobao”, and the like. Therefore, for the shopping application,the following plurality of user statement templates may be configured inthe terminal 100: “Purchase [search word] through (applicationidentifier)”, “Purchase [search word] in (application identifier)”,“Search for [search word] in (application identifier)” “Search for[search word] in (interface identifier) of (application identifier)”,and the like. A connection word in the user statement template “Purchase[search word] through (application identifier) ” is “Purchase . . .through . . . ”. A connection word in the user statement template“Purchase [search word] in (application identifier) ” is “Purchase . . .in . . . ”. A connection word in the user statement template “Search for[search word] in (application identifier) ” is “Search for . . . in . .. ”.

At least one first part in the first text information not only includesthe first application identifier and/or the first interface identifier,but also includes the connection word in the first text information. Forexample, the first text information “Purchase milk through Taobao”includes both the first application identifier “Taobao” and theconnection word “Purchase”.

The travel application “Ctrip” is used as an example. When using “Ctrip”to book a train ticket, the user usually speaks “Book a train ticketfrom place A to place B in Ctrip”, “Purchase a train ticket from place Ato place B”, “Train ticket from place A to place B”, and the like. Inthis case, for the travel application, the following plurality of userstatement templates may be configured in the terminal 100: “Purchase(interface identifier) from [search word 1] to [search word 2] through(application identifier)”, “Purchase (interface identifier) from [searchword 1] to [search word 2]”, “(interface identifier) from [search word1] to [search word 2]”, “(interface identifier) to [search word 2]”, andthe like. A connection word in the user statement template “Purchase(interface identifier) from [search word 1] to [search word 2] through(application identifier)” is “Purchase . . . from . . . to . . . through. . . ”.

The user statement template in this embodiment of this application mayinclude a first filling item and a second filling item. The firstfilling item is used to fill the application identifier and/or theinterface identifier obtained by the terminal 100. The second fillingitem is used to fill the search word obtained by the terminal 100. Thefirst filling item corresponds to the at least one first part in thefirst text information, and the second filling item corresponds to thesecond part in the first text information. In the foregoing userstatement template, “( )” is the first filling item, and “[]” is thesecond filling item. The first filling item “( )” is used to fill theapplication identifier and/or the interface identifier obtained by theterminal 100. The second filling item “[]” is used to fill the searchword obtained by the terminal 100.

For example, it is assumed that the operation information includes anapplication identifier “Taobao”, an interface identifier “Taobao homepage”, and a search word “Milk”. The terminal 100 fills the operationinformation in the user statement template of the shopping application,to obtain the following text information: “Purchase [milk] through(Taobao)”, “Purchase [milk] in (Taobao)”, “Search for [milk] in(Taobao)”, “Search for [milk] on (Taobao) (home page)”, and the like.

It is assumed that the operation information includes an applicationidentifier “Travel”, an interface identifier “Train ticket”, a searchword 1 “Xi'an”, and a search word 2 “Shenzhen”.

The terminal 100 fills the operation information in the user statementtemplate of the travel application, to obtain the following textinformation: “Purchase (train ticket) from [Xi'an] to [Shenzhen] through(travel)”, “Purchase (train ticket) from [Xi'an] to [Shenzhen]”, “(Trainticket) from [Xi'an] to [Shenzhen]”, and the like.

For example, the mobile phone 300 may display, in response to the tapoperation performed by the user on the end button 505 shown in FIG.5(c), a third interface 601 shown in FIG. 6(a). The third interface 601includes a plurality of pieces of text information, for example,“Purchase [milk] through (Taobao)” 602, “Purchase [milk] in (Taobao)”,“Search for [milk] in (Taobao)”, and “Search for [milk] on (Taobao)(home page)”.

After S204, the terminal 100 may determine, based on a third operationentered by the user in the third interface, the first text informationcorresponding to the operation information. Specifically, after S204,the method in this embodiment of this application may further includeS205 and S206.

S205: The terminal 100 receives the third operation performed by theuser on the first text information in the at least two pieces of textinformation in the third interface.

The third operation is used to select the first text information fromthe at least two pieces of text information. The terminal 100 mayreceive a selection operation, namely, the third operation, performed bythe user on one or more pieces of text information in the at least twopieces of text information. For example, as shown in FIG. 6(a), themobile phone 300 may receive a selection operation performed by the useron “Purchase [milk] through (Taobao)” 602 shown in FIG. 6(a).

S206: The terminal 100 determines, in response to the third operation,the first text information as text information corresponding to theoperation information.

The first text information is generated through filling in a first userstatement template. Specifically, the first text information isgenerated by filling the first application identifier and/or the firstinterface identifier in a first filling item in the first user statementtemplate, and filling the first search word in a second filling item inthe first user statement template.

For example, it is assumed that the user selects the command option“Purchase [milk] through (Taobao)” 602 in the third interface 601 shownin FIG. 6(a). The mobile phone 300 may determine, in response to a tapoperation performed by the user on an “OK” button in the third interface601 shown in FIG. 6(a), that “Purchase [milk] through (Taobao)” is atext corresponding to the foregoing operation information. Subsequently,if the terminal 100 receives a voice command whose text matches thefirst text information, the terminal 100 may automatically perform acorresponding operation based on the operation information.

After generating the first text information, the terminal 100 may storethe first text information. The mobile phone 300 is used as an example.After the mobile phone 300 stores the first text information, as shownin FIG. 7(a), a “Custom command 3” is added to a “Custom voice control”interface 701 displayed by the mobile phone 300 compared with the“Custom voice control” interface 401 shown in FIG. 4(a).

S207: The terminal 100 receives a first voice command.

For example, the terminal 100 is the mobile phone 300 shown in FIG.3(a), FIG. 3(b), FIG. 3(c), and FIG. 3(d). The mobile phone 100 maydisplay the voice control interface 303 that is of the voice assistantand that is shown in FIG. 3(b). The mobile phone 300 may receive, inresponse to a touch and hold operation performed by the user on the“Record” button 304, the first voice command entered by the user.

S208: The terminal 100 performs a corresponding operation based on theoperation information when a text of the first voice command matches thefirst text information.

That the text of the first voice command matches the first textinformation includes: at least one third part in the text correspondingto the first voice command is the same as the at least one first part,and a location relationship between the at least one third part and afourth part in the first voice command is the same as a locationrelationship between the at least one first part and the second part inthe first text information.

With reference to the foregoing instance, it is assumed that the firsttext information is “Purchase [milk] through (Taobao)”, the firstapplication identifier is “Taobao”, and the first search word is “Milk”.To be specific, the at least one first part in the first textinformation is “Taobao”, and the second part in the first textinformation is “Milk”. If the first voice command is “Purchase awindbreaker through Taobao”, the terminal 100 may determine that the atleast one third part in the first voice command is “Taobao”, and thefourth part in the first voice command is “Windbreaker”. The at leastone first part “Taobao” in the first text information is the same as theat least one third part “Taobao” in the first voice command, and alocation relationship between the at least one third part “Taobao” andthe fourth part “Windbreaker” in the first voice command “Purchase awindbreaker through Taobao” is the same as a location relationshipbetween the at least one first part “Taobao” and the second part “Milk”in the first text information “Purchase milk through Taobao”. Therefore,the terminal 100 may determine that the first voice command “Purchase awindbreaker through Taobao” matches the first text information “Purchasemilk through Taobao”.

The at least one first part includes the first application identifierand/or the first interface identifier, and the second part includes thefirst search word. In other words, when the third part in the firstvoice command is the first application identifier and/or the firstinterface identifier, and the location relationship between the fourthpart and the third part in the first voice command is the same as thelocation relationship between the first part and the second part in thefirst text information, the terminal 100 may determine that the firstvoice command matches the first text information.

The method in which the terminal 100 performs the correspondingoperation based on the operation information may include: The terminal100 performs an operation corresponding to the first applicationidentifier, the first interface identifier, the operation indicationinformation, and the fourth part (for example, a second search word).For example, with reference to the foregoing instance, the mobile phone300 may receive, in response to a touch and hold operation performed bythe user on a “Record” button 802 in a voice control interface 801 shownin FIG. 8(a), the first voice command entered by the user, for example,“Purchase a windbreaker through Taobao”. The mobile phone 300 maydetermine that the first voice command “Purchase a windbreaker throughTaobao” matches the first text information “Purchase [milk] through(Taobao)”. Therefore, the mobile phone 300 may sequentially displayoperation interfaces shown in FIG. 8(b) to FIG. 8(d). Specifically, themobile phone 300 may start a “Taobao” application based on anapplication identifier “Taobao”, and display a Taobao home page 804shown in FIG. 8(b). The mobile phone 300 may simulate, based on theoperation indication information a and the search word “Windbreaker”, anoperation that the user taps a search box on the Taobao home page 804,display, on the Taobao home page 804 shown in FIG. 8(b), an interface inwhich a finger of the user taps the search box, simulate an operationthat the user enters a search word in the search box on the Taobao homepage 804, and display, on the Taobao home page 804, the search word“Windbreaker” that is in second operation information and that isentered by the user. The mobile phone 300 may simulate, based on theoperation indication information b (indication information used toindicate that the user taps a search button in the search box), the userto tap the search button in the search box, to display a displayinterface 806 shown in FIG. 8(c). Subsequently, the mobile phone 300 maydisplay, in response to a tap operation performed by the user on thesearch button in the search box shown in FIG. 8(c), a search resultinterface 808 shown in FIG. 8(d).

As shown in FIG. 5(a), FIG. 5(b), and FIG. 5(c) and FIG. 6(a) and FIG.6(b), although the first text information recorded by the mobile phone300 is “Purchase milk through Taobao”, after receiving the voice commandthat matches the first text information, the mobile phone 300 mayperform the corresponding operation based on the operation informationthat corresponds to the first text information and that is recorded bythe terminal 100. In this way, regardless of any voice command thatmatches “Purchase milk through Taobao” received by the voice assistantof the mobile phone 300, for example, “Purchase a windbreaker throughTaobao” shown in FIG. 8(a), the mobile phone 300 may simulate the userto trigger the mobile phone 300 to perform an operation corresponding to“Purchase a windbreaker through Taobao”, to display operation interfacescorresponding to FIG. 8(b) to FIG. 8(d).

In this embodiment of this application, a finger icon 805 shown in FIG.8(b) and a finger icon 807 shown in FIG. 8(c) each are used to representa finger that is of the user and that is displayed when the mobile phone300 simulates an operation of the user. A finger icon 803 shown in FIG.8(a) is used to represent a finger that is of the user and that isdisplayed when the mobile phone 300 receives an actual operation of theuser. The finger icon 805 shown in FIG. 8(b) is different from thefinger icon 803 shown in FIG. 8(a).

Optionally, after determining that the first voice command matches thefirst text information, the terminal 100 may directly display anoperation result interface corresponding to the first voice command. Forexample, after receiving the voice command “Purchase a windbreakerthrough Taobao” entered by the user in the voice control interface 801shown in FIG. 8(a), the mobile phone 300 may directly display aninterface 808 shown in FIG. 8(d).

According to the voice control command generation method provided inthis embodiment of this application. The terminal 100 may first obtainthe operation information corresponding to the one or more operations,then connect the first application identifier and/or the first interfaceidentifier and the first search word based on a preset locationrelationship by using the connection word to form a statement, so as toobtain the plurality of pieces of text information, and display thethird interface including the plurality of pieces of text information,so that the user selects, from the plurality of pieces of textinformation, the first text information that conforms to a languagehabit of the user. The first text information is a command that isselected by the user and that conforms to the language habit of theuser. After the terminal 100 receives the first voice command, theterminal 100 may perform the corresponding operation based on theoperation information provided that the text of the first voice commandmatches the first text information, instead of performing thecorresponding operation only when the user speaks a voice commandcorresponding to the text information word by word. According to thissolution, flexibility of custom voice control can be improved and userexperience can be improved.

Further, after the terminal 100 determines the first text information asthe text information corresponding to the operation information (namely,S206), before the terminal 100 receives the first voice command (namely,S207), the method in this embodiment of this application may include5901, so that after receiving the first voice command, the terminal 100can more quickly and accurately identify that the first voice command isa voice command that matches the first text information, and thenperform the corresponding operation based on the operation information.As shown in FIG. 9, after S206 shown in FIG. 2, before S207, the methodin this embodiment of this application may further include S901.

S901: The terminal 100 generates a first template text.

The first template text is generated by replacing the second part in thefirst text information with type information of the first search word.In other words, if the first text information is generated throughfilling in the first user statement template, the first template text isgenerated by filling the first application identifier and/or the firstinterface identifier in the first filling item in the first userstatement template, and filling the type information of the first searchword in the second filling item in the first user statement template.

The terminal 100 may obtain the type information of the first searchword; and replace the first search word in the first text informationwith the type information of the first search word, to obtain a firsttemplate command. Alternatively, the terminal 100 may obtain the typeinformation of the first search word; and fill the first applicationidentifier and/or the first interface identifier in the first fillingitem in the first user statement template, and fill the type informationof the first search word in the second filling item in the first userstatement template, to obtain the first template text.

For example, with reference to the foregoing instance, it is assumedthat the first text information is “Purchase [milk] through (Taobao)”.The mobile phone 300 may learn that the type information of the firstsearch word “Milk” is “Commodity”. Then, the mobile phone 300 mayreplace “Milk” in “Purchase [milk] through (Taobao)” with “Commodity”,to obtain the first template text “Purchase [commodity] through(Taobao)”. Alternatively, assuming that the first text information is“Purchase [milk] through (Taobao)”, and the first user statementtemplate is “Purchase [search word] through (application identifier)”,the first search word is “Milk”, and the first application identifier is“Taobao”. The mobile phone 300 may learn that the type information ofthe first search word “Milk” is “Commodity”. Then, the mobile phone 300may fill the first application identifier “Taobao” in the first fillingitem “0”, and fill the first search word “Milk” in the first fillingitem “[]”, to obtain the first template text “Purchase [commodity]through (Taobao)”.

That the text of the first voice command matches the first textinformation may be specifically: the text of the first voice commandmatches the first template text. As shown in FIG. 9, S208 shown in FIG.2 may include S902.

S902: The terminal 100 performs the corresponding operation based on theoperation information when the text of the first voice command matchesthe first template text.

That the text of the first voice command matches the first template textmay include: the at least one third part in the text corresponding tothe first voice command is the same as the at least one first part, thelocation relationship between the at least one third part and the fourthpart in the first voice command is the same as the location relationshipbetween the at least one first part and the second part in the firsttext information, and the fourth part is a word of a type indicated bytype information in the first template text.

With reference to the foregoing instance, it is assumed that the firsttemplate text is “Purchase [commodity] through Taobao”. If the firstvoice command is “Purchase a windbreaker through Taobao”, the terminal100 may determine that the at least one third part “Taobao” in the firstvoice command “Purchase a windbreaker through Taobao” is the same as theat least one first part “Taobao” in the first template text, a locationrelationship between the at least one third part “Taobao” and the fourthpart “Windbreaker” in the first voice command “Purchase a windbreakerthrough Taobao” is the same as a location relationship between the atleast one first part “Taobao” and the second part “Milk” in the firsttext information “Purchase milk through Taobao”, and the fourth part“Windbreaker” is a word of a commodity type indicated by “Commodity” inthe first template text “Purchase [commodity] through Taobao”.Therefore, the terminal 100 may determine that the first voice command“Purchase a windbreaker through Taobao” matches the first textinformation “Purchase milk through Taobao”.

Alternatively, assuming that the first user statement template is“Purchase [search word] through (application identifier)”, and the firsttext information is “Purchase [milk] through (Taobao)”, the firstapplication identifier is “Taobao”, the first search word is “Milk”, andthe type information of the first search word “Milk” is “Commodity”. Theterminal 100 may generate the first template text “Purchase [commodity]through Taobao”.

If the first voice command is “Purchase a windbreaker through Taobao”,the terminal 100 may determine that the first voice command “Purchase awindbreaker through Taobao” conforms to the first user statementtemplate “Purchase [search word] through (application identifier)”. Thefirst voice command “Purchase a windbreaker through Taobao” includes thefirst application identifier “Taobao”, and the second search word“Windbreaker” included in the first voice command “Purchase awindbreaker through Taobao” is the word of the commodity type.Therefore, the terminal 100 may determine that the first voice command“Purchase a windbreaker through Taobao” matches the first template text“Purchase [commodity] through Taobao”.

After obtaining the operation information, the terminal 100 may storethe operation information (referred to as first operation information).The terminal 100 may further store a correspondence between the firsttemplate text and the operation information after generating the firsttemplate text. In this way, after determining that the first voicecommand matches the first template text, the terminal 100 may find thefirst operation information corresponding to the first template text.The first operation information includes the first applicationidentifier, the first interface identifier, the first search word, andthe operation indication information, the first voice command includesthe second search word. Therefore, the terminal 100 may obtain thesecond operation information that includes the first applicationidentifier, the first interface identifier, the second search word, andthe operation indication information. The terminal 100 may perform anoperation corresponding to the first application identifier, the firstinterface identifier, the operation indication information, and thesecond search word (namely, the second operation information).

For example, with reference to the foregoing instance, assuming that thefirst template text is “Purchase [commodity] in Taobao”, and the firstvoice command is “Purchase [windbreaker] in Taobao”, the secondoperation information may include an application identifier “Taobao”, aninterface identifier “Taobao home page”, and a search word“Windbreaker”. The mobile phone 300 may receive, in response to a touchand hold operation performed by the user on a “Record” button 802 in avoice control interface 801 shown in FIG. 8(a), the first voice commandentered by the user, for example, “Purchase a windbreaker throughTaobao”. The mobile phone 300 may determine that the first voice command“Purchase a windbreaker through Taobao” matches the first template text“Purchase [commodity] in Taobao”. Therefore, the mobile phone 300 maysequentially display operation interfaces shown in FIG. 8(b) to FIG.8(d). Specifically, the mobile phone 300 may start a “Taobao”application based on an application identifier “Taobao” in the secondoperation information, and display a Taobao home page 804 shown in FIG.8(b). The mobile phone 300 may simulate, based on the operationindication information a and the search word “Windbreaker”, an operationthat the user taps a search box on the Taobao home page 804, display, onthe Taobao home page 804 shown in FIG. 8(b), an interface 804 in which afinger of the user taps the search box, simulate an operation that theuser enters a search word in the search box on the Taobao home page 804,and display, on the Taobao home page 804, the search word “Windbreaker”that is in the second operation information and that is entered by theuser. The mobile phone 300 may simulate, based on the operationindication information b (indication information used to indicate thatthe user taps a search button in the search box), the user to tap thesearch button in the search box, to display a display interface shown inFIG. 8(c). Subsequently, the mobile phone 300 may display, in responseto a tap operation performed by the user on the search button in thesearch box shown in FIG. 8(c), a search result interface 808 shown inFIG. 8(d).

As shown in FIG. 5(a), FIG. 5(b), and FIG. 5(c) and FIG. 6(a) and FIG.6(b), although the first text information recorded by the mobile phone300 is “Purchase milk through Taobao”, the mobile phone 300 may generatethe first template text “Purchase a commodity through Taobao” of thefirst text information. In this way, regardless of any voice commandthat matches “Purchase a commodity through Taobao” received by the voiceassistant of the mobile phone 300, for example, “Purchase a windbreakerthrough Taobao” shown in FIG. 8(a), the mobile phone 300 may simulate anoperation performed when the user triggers the mobile phone 300 toperform an event corresponding to “Purchase a windbreaker throughTaobao”, to display operation interfaces corresponding to FIG. 8(b) toFIG. 8(d).

In this embodiment of this application, a finger icon 805 shown in FIG.8(b) and a finger icon 807 shown in FIG. 8(c) each are used to representa finger that is of the user and that is displayed when the mobile phone300 simulates an operation of the user. A finger icon 803 shown in FIG.8(a) is used to represent a finger that is of the user and that isdisplayed when the mobile phone 300 receives an actual operation of theuser. The finger icon 805 shown in FIG. 8(b) is different from thefinger icon 803 shown in FIG. 8(a).

Optionally, after determining that the first voice command matches thefirst template text, the terminal 100 may directly display an operationresult interface corresponding to the second operation information. Forexample, after receiving the voice command “Purchase a windbreakerthrough Taobao” entered by the user in the voice control interface 801shown in FIG. 8(a), the mobile phone 300 may directly display, based onthe second operation information, an interface 808 shown in FIG. 8(d).

After generating the first template text, the terminal 100 may store thefirst template text. The mobile phone 300 is used as an example. Afterthe mobile phone 300 stores the first template text, as shown in FIG.7(b), one piece of text information 703, for example, “Purchase acommodity (milk) through Taobao” is added to a “Custom voice control”interface 702 displayed by the mobile phone 300 compared with the“Custom voice control” interface 401 shown in FIG. 4(a).

Optionally, after generating the first template text, the terminal 100may further display a fourth interface. The fourth interface is used toprompt the user to send, through the voice assistant, the first voicecommand that matches the first template text, to trigger the terminal100 to perform a corresponding operation.

For example, it is assumed that the user selects the command option“Purchase [milk] through (Taobao)” 602 in the third interface 601 shownin FIG. 6(a). In response to a tap operation performed by the user onthe “OK” button in the third interface 601 shown in FIG. 6(a), themobile phone 300 may generate the first template text “Purchase[commodity] through (Taobao)”, and display a fourth interface 603 shownin FIG. 6(b). The fourth interface 603 may include third promptinformation “Based on your operation, next time you may speak to thevoice assistant: Purchase ** through Taobao” 604. Optionally, as shownin FIG. 6(b), the fourth interface 603 may further include statementinstances of the first template text “Purchase ** through Taobao”, forexample, “Purchase a pen through Taobao” and “Purchase milk throughTaobao”.

In this embodiment of this application, the terminal 100 may firstobtain the operation information corresponding to the one or moreoperations, and then display the third interface including the pluralityof pieces of text information, so that the user selects, from theplurality of pieces of text information, the first text information thatconforms to a voice habit of the user. The plurality of pieces of textinformation are generated by filling the operation information in theuser statement template stored in the terminal 100. The terminal 100 mayfill the first application identifier and/or the first interfaceidentifier in the first filling item in the first user statementtemplate, and fill the type information of the first search word in thesecond filling item in the first user statement template, to generatethe first template text. If the terminal 100 receives, next time, avoice command that matches the template text, even if an operationcorresponding to the voice command is not recorded in the terminal 100,the terminal 100 may also simulate the user to trigger the terminal 100to perform the operation corresponding to the voice command, and displaya corresponding operation interface. In this way, flexibility of customvoice control can be improved and user experience can be improved.

In this embodiment of this application, an example in which the terminalrecords one or more operations performed by the user on the “Travel”application is used herein to describe the method in this embodiment ofthis application.

The terminal 100 may display the second interface in response to thefourth operation performed by the user in the first interface. Thesecond interface is a general term for a plurality of interfaces used toreceive the one or more operations. Usually, the terminal 100 may firstdisplay a first sub-interface in response to the fourth operation. Forexample, the terminal 100 is the mobile phone 300. The mobile phone 300may display a first sub-interface 409 shown in FIG. 4(c).

It is assumed that the user taps a “Travel” application icon in thefirst sub-interface 409.

In response to a tap operation (namely, a first sub-operation) performedby the user on the “Travel” application icon in the first sub-interface409, the mobile phone 300 may display a second sub-interface 1001 shownin FIG. 10(a), and obtain a first application identifier “Travel”. Thesecond sub-interface 1001 includes second prompt information 1002 and a“Travel” home page 1003. For example, the second prompt information 1003is “Enter one or more operations corresponding to text information in aninterface of the ‘Travel’ application”. The mobile phone 300 may receivea tap operation performed by the user on a “Train ticket” option in thesecond sub-interface 1001. The mobile phone 300 may display, in responseto a tap operation performed by the user on the “Train ticket” option, athird sub-interface 1005 shown in FIG. 10(b). The third sub-interface1005 includes the second prompt information and a train ticket interface1006. The mobile phone 300 may obtain, in response to the tap operationperformed by the user on the “Train ticket” option, operation indicationinformation c used to indicate that the user taps the “Train ticket”option and an interface identifier of the train ticket interface 1006.The user may tap a “Departure place” option in the train ticketinterface 1006 to modify a departure place. As shown in FIG. 10(b), adeparture place currently displayed in the “Departure place” option isShanghai. The user may further tap a “Destination” option in the trainticket interface 1006 to modify a destination. As shown in FIG. 10(b), adestination currently displayed in the “Destination” option is Beijing.For example, the user modifies the destination. As shown in FIG. 10(b),it is assumed that the user operates the “Destination” option to modifythe destination to Shenzhen. The mobile phone 300 may display, inresponse to an operation performed by the user on the “Destination”option, a fourth sub-interface 1007 shown in FIG. 10(c). The thirdsub-interface 1005 includes the second prompt information and the trainticket interface 1006. A destination currently displayed in a“Destination” option in a train ticket interface 1008 is Shenzhen. Themobile phone 300 may obtain, in response to operations performed by theuser on the “Departure place” option and the “Destination” option,operation indication information d used to indicate that the usermodifies the “Departure place” option and the “Destination” option, asearch word “Xi'an” entered by the user in the “Departure place” option,and a search word “Shenzhen” entered by the user in in the “Destination”option.

In conclusion, the operation information obtained by the mobile phone300 may include an application identifier of the “Travel” application, ahome page identifier of the “Travel” application, the operationindication information c, an interface identifier of the train ticketinterface 1006, the operation indication information d, the search word“Xi'an” entered in the “Departure place” option, and the search word“Shenzhen” entered in the “Destination” option.

FIG. 10(a) to FIG. 10(c) each include an end button 1004. For example,in response to a tap operation (namely, a second operation) performed bythe user on the end button 1004 shown in FIG. 10(c), the mobile phone300 may end recording of one or more operations, and display a thirdinterface.

For the travel application, the following plurality of user statementtemplates may be configured in the terminal 100: “Purchase (interfaceidentifier) from [search word 1] to [search word 2] in (applicationidentifier)”, “Purchase (interface identifier) from [search word 1] to[search word 2]”, “(interface identifier) from [search word 1] to[search word 2]”, “(interface identifier) to [search word 2]”, and thelike. It is assumed that the operation information includes anapplication identifier “Travel”, an interface identifier of the trainticket interface 1006, a search word “Xi'an” entered in the “Departureplace” option, a search word “Shenzhen” entered in the “Destination”option, and an interface identifier of the train ticket interface 1008.The mobile 300 fills the operation information in the user statementtemplate of the travel application, to obtain the following textinformation: “Purchase (train ticket) from [Xi'an] to [Shenzhen] in(travel)”, “Purchase (train ticket) from [Xi'an] to [Shenzhen]”, “(Trainticket) from [Xi'an] to [Shenzhen]”, and the like.

For example, the mobile phone 300 may display, in response to the tapoperation performed by the user on the end button 1004 shown in FIG.10(c), a third interface 1101 shown in FIG. 11(a). The third interface1101 includes a plurality of pieces of text information, for example,“Purchase (train ticket) from [Xi'an] to [Shenzhen] in (travel)”,“Purchase (train ticket) from [Xi'an] to [Shenzhen]”, “(Train ticket)from [Xi'an] to [Shenzhen]” 1102, and “(Train ticket) to [Shenzhen]”1103.

The terminal 100 may receive a selection operation performed by the useron one or more pieces of text information in the third interface. Forexample, the mobile phone 300 may receive a selection operationperformed by the user on the text information “(Train ticket) from[Xi'an] to [Shenzhen]” 1102 and “(Train ticket) to [Shenzhen]” 1103 inthe third interface 1101. The mobile phone 300 may generate, in responseto a selection operation performed by the user on the text information“(Train ticket) from [Xi'an] to [Shenzhen]” 1102 displayed in the thirdinterface 1101, a first template text “(Train ticket) from [departureplace] to [destination]” by using a first user statement template“(interface identifier) from [departure place] to [destination]”. Themobile phone 300 may generate, in response to a selection operationperformed by the user on the text information “(Train ticket) to[Shenzhen]” 1103 displayed in the third interface 1101, a first templatetext “(Train ticket) to [destination]” by using a first user statementtemplate “(interface identifier) to [destination]”.

The mobile phone 300 may display, in response to the selection operationperformed by the user on the first text information “(Train ticket) from[Xi'an] to [Shenzhen]” 1102 and “(Train ticket) to [Shenzhen]” 1103, afourth interface 1108 shown in FIG. 11(c). The fourth interface 1108 mayinclude third prompt information “Based on your operation, next time youmay speak to the voice assistant: (Train ticket) from [departure place]to [destination] and (Train ticket) to [destination]”. Optionally, asshown in FIG. 11(c), the fourth interface 1108 may further include astatement instance of the first template text “(Train ticket) from[departure place] to [destination]”, for example, “Train ticket fromShanghai to Xi'an”, and a statement instance of the first template text“(Train ticket) to [destination]”, for example, “Train ticket to Xi'an”.

The mobile phone 300 may receive, in response to a touch and holdoperation performed by the user on a “Record” button 1202 in a voicecontrol interface 1201 shown in FIG. 12(a), the first voice commandentered by the user, for example, “Train ticket from Shanghai to Xi'an”.The mobile phone 300 may determine that the first voice command “Trainticket from Shanghai to Xi'an” matches the first template text “(Trainticket) from [departure place] to [destination]”. Therefore, the mobilephone 300 may sequentially display operation interfaces shown in FIG.12(b) to FIG. 12(d).

The operation information (namely, the first operation information)includes an application identifier of the “Travel” application, a homepage identifier of the “Travel” application, the operation indicationinformation c, an interface identifier of the train ticket interface1006, the operation indication information d, the search word “Xi'an”entered in the “Departure place” option, and the search word “Shenzhen”entered in the “Destination” option, and the first voice command is“Train ticket from Shanghai to Xi'an”. Therefore, the second operationinformation includes an application identifier of the “Travel”application, a home page identifier of the “Travel” application, theoperation indication information c, an interface identifier of the trainticket interface, the operation indication information d, the searchword “Shanghai” entered in the “Departure place” option, and the searchword “Xi'an” entered in the “Destination” option.

In response to the first voice command “Train ticket from Shanghai toXi'an” entered by the user in the voice control interface 1201, themobile phone 300 may start a “Travel” application based on theapplication identifier “Travel” in the second operation information, anddisplay a home page of the “Travel” application based on the home pageidentifier of the “Travel” application. The mobile phone 300 maysimulate, based on the operation indication information c (operationindication information used to indicate that the user taps a “Trainticket” option on the home page of the “Travel” application), the userto tap the “Train ticket” option on the home page of the “Travel”application, to display an interface 1203 shown in FIG. 12(b).Subsequently, the mobile phone 300 may display a train ticket interfacebased on an interface identifier of the train ticket interface, andsimulate, based on the operation indication information d (operationindication information used to indicate that the user modifies the“Departure place” option and the

“Destination” option), operation indication information used to modifythe “Departure place” option and the “Destination” option, to display aninterface 1204 shown in FIG. 12(c). In addition, the mobile phone 300may display, based on the search word “Shanghai” entered in the“Departure place” option and the search word “Xi'an” entered in the“Destination” option, a display interface 1205 shown in FIG. 12(d). Inthis way, after the user enters the voice command “Train ticket fromShanghai to Xi'an” to the mobile phone 300 in the voice controlinterface 1201 shown in FIG. 12(a), the mobile phone 300 mayautomatically display the operation interfaces shown in FIG. 12(b) toFIG. 12(d). The user only needs to tap a “Query” button in the interface1205 shown in FIG. 12(d), to trigger the mobile phone 300 to query atrain ticket from Shanghai to Xi'an.

Considering that the user may have different names (or statements) for asame object, before displaying the fourth interface, the terminal 100may further display a fifth interface including an alias input box. Inthis way, the user may create an alias for the first text information inthe alias input box. Specifically, that the terminal 100 displays afourth interface may include: The terminal 100 displays a fifthinterface. The fifth interface includes an alias input box. The aliasinput box is used to receive second text information, and the secondtext information is an alias created by the user for the first textinformation. The terminal 100 receives a fifth operation performed bythe user in the fifth interface. The fifth operation is used to triggerthe terminal 100 to end recording of text information. The terminal 100displays the fourth interface in response to the fifth operation.

For example, the mobile phone 300 may display, in response to theselection operation performed by the user on the first text information“(Train ticket) from [Xi'an] to [Shenzhen]” 1102 and “(Train ticket) to[Shenzhen]” 1103 in the third interface 1101 shown in FIG. 11(a), afifth interface 1104 shown in FIG. 11(b). The fifth interface 1104includes an alias input box 1107.

The mobile phone 300 may display, in response to a selection operationperformed by the user on first text information “Purchase (milk) through[Taobao]” 1302 in a third interface 1301 shown in FIG. 13(a), a fifthinterface 1303 shown in FIG. 13(b). The fifth interface 1303 includes analias input box 1305.

Optionally, the fifth interface may further include prompt informationused to indicate the user to enter the second text information in thealias input box. For example, the fifth interface 1303 shown in FIG.13(b) further includes prompt information “Tip: You may enter an aliasfor the foregoing command in the alias input box”.

Optionally, the fifth interface may further include fourth promptinformation. The fourth prompt information is used to indicate the firsttext information selected by the user. For example, the fifth interface1104 shown in FIG. 11(b) further includes fourth prompt information“(Train ticket) from [Xi'an] to [Shenzhen]” 1105 and “(Train ticket) to[Shenzhen]” 1106. The fifth interface 1303 shown in FIG. 13(b) furtherincludes fourth prompt information “Purchase (milk) through [Taobao]”1304.

The fifth operation performed by the user in the fifth interface may bea tap operation (for example, a single tap operation) performed by theuser on an “OK” button in the fifth interface. For example, the fifthoperation may be a tap operation performed by the user on an “OK” buttonshown in FIG. 11(b). Alternatively, the fifth operation performed by theuser in the fifth interface may be a preset gesture entered by the userin the fifth interface. For example, the preset gesture may be aslide-up gesture, an S-shaped gesture, or the like.

It may be understood that some users do not enter the second textinformation in the alias input box in the fifth interface. In otherwords, the user does not create an alias for the first text information.In this case, the terminal 100 may directly display the fourth interfacein response to the fifth operation. For example, the mobile phone 300may display, in response to the tap operation performed by the user onthe “OK” button shown in FIG. 11(b), a fourth interface 1108 shown inFIG. 11(c).

Some other users enter the second text information in the alias inputbox in the fifth interface, to create an alias for the first textinformation. In this case, after the terminal 100 displays the fifthinterface, the terminal 100 may receive the second text informationentered by the user in the alias input box, and display the second textinformation in the alias input box. Correspondingly, the terminal 100may store the second text information and a correspondence between thesecond text information and the operation information in response to thefifth operation performed by the user in the fifth interface. In thisway, after receiving a second voice command whose text is the same asthe second text information, the terminal 100 may perform, based on theoperation information corresponding to the second text information, anoperation corresponding to the operation information.

For example, the mobile phone 300 may receive second text information“Milk in Taobao” entered by the user in the alias input box 1305 in thefifth interface 1303 shown in FIG. 13(b), and display a fifth interface1306 shown in FIG. 13(c). In the fifth interface 1306 shown in

FIG. 13(c), the second text information “Milk in Taobao” is displayed inthe alias input box 1305. The mobile phone 300 may display, in responseto a tap operation performed by the user on an “OK” button shown in FIG.13(c), a fourth interface 1308 that is shown in FIG. 13(d) and thatincludes second text information “Milk in Taobao” 1310.

It is assumed that the second text information is “Milk in Taobao”, andthe operation information includes the application identifier “Taobao”,the operation indication information a, the operation indicationinformation b, and the search word “Milk”. The mobile phone 300 maystore a correspondence between the second text information “Milk inTaobao” and the operation information including the applicationidentifier “Taobao”, the operation indication information a, theoperation indication information b, and the search word “Milk”. Thecorrespondence between the second text information and the operationinformation is used to: when the terminal 100 receives the second voicecommand whose text is the same as the second text information, indicatethe terminal 100 to simulate the user to trigger the terminal 100 toperform an operation corresponding to the second voice command, anddisplay a corresponding operation interface.

According to the voice control command generation method provided inthis embodiment of this application, the terminal 100 may furtherprovide a service of the alias (namely, the second text information)created by the user for the first text information. In addition, whenreceiving the second text information, the voice assistant of theterminal 100 may also simulate the user to trigger the terminal 100 toperform an operation corresponding to the second voice command, anddisplay a corresponding operation interface. In this way, flexibility ofcustom voice control can be improved and user experience can beimproved.

It may be understood that to implement the foregoing functions, theterminal or the like includes corresponding hardware structures and/orsoftware modules for performing the functions. A person skilled in theart should be easily aware that units, algorithms, and steps in theexamples described with reference to the embodiments disclosed in thisspecification, the embodiments of this application can be implemented byhardware or a combination of hardware and computer software. Whether afunction is performed by hardware or hardware driven by computersoftware depends on particular applications and design constraints ofthe technical solutions. A person skilled in the art may use differentmethods to implement the described functions for each particularapplication, but it should not be considered that the implementationgoes beyond the scope of the embodiments of this application.

In the embodiments of this application, the terminal or the like may bedivided into function modules based on the foregoing method examples.For example, each function module may be obtained through division basedon each corresponding function, or two or more functions may beintegrated into one processing module. The integrated module may beimplemented in a form of hardware, or may be implemented in a form of asoftware function module. It should be noted that in the embodiments ofthis application, division into the modules is an example and is merelylogical function division, and may be other division in an actualimplementation.

When each function module is obtained through division based on eachcorresponding function, FIG. 14 is a possible schematic structuraldiagram of a terminal in the foregoing embodiments. The terminal 1400includes a display unit 1401, an input unit 1402, a recording unit 1403,a determining unit 1404, and an execution unit 1405.

The display unit 1401 is configured to support the terminal 1400 inperforming the operation of “displaying the prompt information inresponse to the first operation”, S201, S202, and S204 in the foregoingmethod embodiment, and/or is configured to perform another process ofthe technology described in this specification.

The input unit 1402 is configured to support the terminal 1400 inperforming the operation of “receiving the first operation entered bythe user”, the operation of “receiving the second operation entered bythe user”, the operation of “receiving the fourth operation entered bythe user in the first interface”, S205, S207, the operation of“receiving the fifth operation entered by the user”, and the operationof “receiving the second text information entered by the user in thealias input box” in the foregoing method embodiment, and/or isconfigured to perform another process of the technology described inthis specification. The recording unit 1403 is configured to support theterminal 1400 in performing S203 in the foregoing method embodiment,and/or is configured to perform another process of the technologydescribed in this specification. The determining unit 1404 is configuredto support the terminal 1400 in performing S206 in the foregoing methodembodiment, and/or is configured to perform another process of thetechnology described in this specification. The execution unit 1405 isconfigured to support the terminal 1400 in performing S208 and S902 inthe foregoing method embodiment, and/or is configured to perform anotherprocess of the technology described in this specification.

The terminal 1400 may further include a generation unit and a storageunit. The generation unit is configured to support the terminal 1400 inperforming S901 in the foregoing method embodiment, and/or is configuredto perform another process of the technology described in thisspecification.

The storage unit is configured to store operation information, firsttext information, second text information, a first template text, acorrespondence between the second text information and the operationinformation, and the like.

All related content of the steps in the foregoing method embodiments maybe cited in function descriptions of corresponding function modules.Details are not described herein again.

Certainly, the terminal 1400 includes but is not limited to the unitsand modules listed above. For example, the terminal 300 may furtherinclude a receiving unit and a sending unit. The receiving unit isconfigured to receive data or an instruction sent by another terminal.The sending unit is configured to send data or an instruction to anotherterminal. In addition, functions that can be specifically implemented bythe function units include but are not limited to functionscorresponding to the method steps in the foregoing instances. Fordetailed descriptions of other units of the terminal 1400, refer todetailed descriptions of the method steps corresponding to the units.Details are not described herein again in this embodiment of thisapplication.

When an integrated unit is used, FIG. 15 is a possible schematicstructural diagram of a terminal in the foregoing embodiments. Theterminal 1500 includes a processing module 1501, a storage module 1502,and a display module 1503. The processing module 1501 is configured to:control and manage an action of the terminal 1500. The display module1503 is configured to display an image generated by the processingmodule 1501. The storage module 1502 is configured to store program codeand data that are of the terminal. For example, the storage module 1502stores operation information, first text information, second textinformation, a first template text, a correspondence between the secondtext information and the operation information, and the like.Optionally, the terminal 1500 may further include a communicationsmodule, configured to support the terminal in communicating with anothernetwork entity. For detailed descriptions of the units included in theterminal 1500, refer to the descriptions in the foregoing methodembodiments. Details are not described herein again.

The processing module 1501 may be a processor or a controller, forexample, may be a central processing unit (Central Processing Unit,CPU), a general-purpose processor, a digital signal processor (DigitalSignal Processor, DSP), an application-specific integrated circuit(Application-Specific Integrated Circuit, ASIC), a field programmablegate array (Field Programmable Gate Array, FPGA), another programmablelogic device, a transistor logic device, a hardware component, or anycombination thereof. The processor may implement or execute variousexample logical blocks, modules, and circuits described with referenceto content disclosed in this application. The processor mayalternatively be a combination of processors implementing a computingfunction, for example, a combination of one or more microprocessors or acombination of a DSP and a microprocessor. The communications module maybe a transceiver, a transceiver circuit, a communications interface, orthe like. The storage module 1502 may be a memory.

When the processing module 1501 is a processor (for example, theprocessor 110 shown in FIG. 1), the communications module includes aWi-Fi module and a Bluetooth module (for example, the communicationsmodule 160 shown in FIG. 1). The communications module such as the Wi-Fimodule and the Bluetooth module may be collectively referred to as acommunications interface. The storage module 1502 is a memory (forexample, the internal memory 121 shown in FIG. 1). When the displaymodule 1503 is a touchscreen (including the display screen 194 shown inFIG. 1), the terminal provided in this embodiment of this applicationmay be the terminal 100 shown in FIG. 1. The processor, thecommunications interface, the touchscreen, and the memory may be coupledtogether by using a bus.

An embodiment of this application further provides a computer storagemedium. The computer storage medium stores computer program code, andwhen the processor executes the computer program code, the terminalperforms related method steps in FIG. 2 or FIG. 9 to implement themethod in the foregoing embodiment.

An embodiment of this application further provides a computer programproduct. When the computer program product is run on a computer, thecomputer is enabled to perform related method steps in FIG. 2 or FIG. 9to implement the method in the foregoing embodiment.

The terminal 1400, the terminal 1500, the computer storage medium, andthe computer program product provided in the embodiments of thisapplication each are configured to perform the corresponding methodprovided above. Therefore, for beneficial effects that can be achievedby the terminal 1400, the terminal 1500, the computer storage medium,and the computer program product, refer to the beneficial effects in thecorresponding method provided above. Details are not described hereinagain.

Based on the foregoing descriptions of the implementations, a personskilled in the art may clearly understand that for the purpose ofconvenient and brief descriptions, division into the foregoing functionmodules is merely used as an example for illustration. In actualapplication, the foregoing functions can be allocated to differentmodules for implementation based on a requirement, that is, an innerstructure of an apparatus is divided into different function modules toimplement all or some of the functions described above.

In the several embodiments provided in this application, it should beunderstood that the disclosed apparatus and method may be implemented inanother manner. For example, the described apparatus embodiments aremerely examples. For example, division into the modules or units ismerely logical function division, and may be other division in an actualimplementation. For example, a plurality of units or components may becombined or may be integrated into another apparatus, or some featuresmay be ignored or not be performed. In addition, the displayed ordiscussed mutual couplings or direct couplings or communicationconnections may be implemented through some interfaces. The indirectcouplings or communication connections between the apparatuses or unitsmay be implemented in an electronic form, a mechanical form, or inanother form.

The units described as separate parts may or may not be physicallyseparate, and parts displayed as units may be one or more physicalunits, and may be located in one place, or may be distributed ondifferent places. Some or all of the units may be selected based on anactual requirement to achieve the objectives of the solutions of theembodiments.

In addition, function units in the embodiments of this application maybe integrated into one processing unit, or each of the units may existalone physically, or two or more units are integrated into one unit. Theintegrated unit may be implemented in a form of hardware, or may beimplemented in a form of a software function unit.

When the integrated unit is implemented in a form of a software functionunit and sold or used as an independent product, the integrated unit maybe stored in a readable storage medium. Based on such an understanding,the technical solutions of the embodiments of this applicationessentially, or the part contributing to the prior art, or all or someof the technical solutions may be implemented in a form of a softwareproduct. The software product is stored in a storage medium and includesseveral instructions for instructing a device (which may be asingle-chip microcomputer, a chip, or the like) or a processor(processor) to perform all or some of the steps of the methods in theembodiments of this application. The storage medium includes any mediumthat can store program code, for example, a USB flash drive, a removablehard disk, a ROM, a RAM, a magnetic disk, or an optical disc.

The foregoing descriptions are merely specific implementations of thisapplication, but are not intended to limit the protection scope of thisapplication. Any variation or replacement within the technical scopedisclosed in this application shall fall within the protection scope ofthis application. Therefore, the protection scope of this applicationshall be subject to the protection scope of the claims.

1.-20. (canceled)
 21. A voice control command generation methodimplemented by a terminal, wherein the voice control command generationmethod comprises: displaying, in response to a first operation, promptinformation prompting a user to enter a to-be-recorded operation;receiving, from the user, one or more operations; recording, in responseto a second operation of the one or more operations, operationinformation corresponding to the one or more operations; determining,based on a third operation of the one or more operations, first textinformation corresponding to the operation information, wherein thefirst text information comprises a first part and a second part;receiving a first voice command; and performing a first correspondingoperation based on the operation information when a first textcorresponding to the first voice command matches the first textinformation, wherein the first text matches the first text informationcomprises: the first text is not the same as the first text information;and a first location relationship of a third part and a fourth part inthe first text is the same as a second location relationship between thefirst part and the second part, and wherein either the third part isdifferent from the first part or the fourth part is different from thesecond part.
 22. The voice control command generation method of claim21, wherein the operation information comprises a first applicationidentifier, a first interface identifier, a first search word, andoperation indication information, wherein the first applicationidentifier is of an operation object application corresponding to theone or more operations, wherein the first interface identifier is of anoperation object interface corresponding to the one or more operations,wherein the operation indication information indicates an operationperformed in the operation object interface through the one or moreoperations, wherein the first part comprises the first applicationidentifier or the first interface identifier, and wherein the secondpart comprises the first search word.
 23. The voice control commandgeneration method of claim 21, further comprising: displaying, inresponse to the first operation, the prompt information in a firstinterface of a voice assistant; receiving, from the user, a fourthoperation in the first interface; displaying, in response to the fourthoperation, a second interface to enter, by the user, the one or moreoperations; and receiving, from the user, the one or more operations inthe second interface.
 24. The voice control command generation method ofclaim 22, wherein before determining the first text information, thevoice control command generation method further comprises: displaying,in response to the second operation, a third interface comprising atleast two pieces of text information, wherein the at least two pieces oftext information are a statement formed by connecting the firstapplication identifier or the first interface identifier and the firstsearch word based on a preset location relationship using a connectionword; receiving, from the user, the third operation on the first textinformation in the at least two pieces of text information, wherein thethird operation selects the first text information from the at least twopieces of text information; and determining, in response to the thirdoperation, the first text information as second text informationcorresponding to the operation information.
 25. The voice controlcommand generation method of claim 22, wherein after determining thefirst text information and before receiving the first voice command, thevoice control command generation method further comprises: generating afirst template text by replacing the second part with type informationof the first search word; and identifying that the first text matchesthe first template text, wherein the third part is the same as the firstpart, wherein the first location relationship is the same as the secondlocation relationship, and wherein the fourth part is a word of a typeindicated by the type information.
 26. The voice control commandgeneration method of claim 25, wherein after generating the firsttemplate text, and before receiving the first voice command, the voicecontrol command generation method further comprises, displaying a fourthinterface prompting the user to send, through a voice assistant, thefirst voice command that matches the first template text to trigger theterminal to perform a second corresponding operation.
 27. The voicecontrol command generation method of claim 26, wherein before displayingthe fourth interface, the voice control command generation methodfurther comprises: displaying a fifth interface comprising an aliasinput box, wherein the alias input box receives third text information,and wherein the third text information is an alias for the first textinformation; receiving the third text information from the user in thealias input box; displaying the third text information in the aliasinput box; receiving, a fifth operation from the user in the fifthinterface, wherein the fifth operation triggers the terminal to endrecording of text information; displaying the fourth interface inresponse to the fifth operation; and storing, in response to the fifthoperation, the third text information and a correspondence between thethird text information and the operation information, wherein the fourthinterface further comprises the third text information.
 28. The voicecontrol command generation method of claim 27, further comprising:receiving, from the user, a second voice command through the voiceassistant; and performing, based on the correspondence, a sixthoperation corresponding to the operation information when a second textof the second voice command is the same as the third text information.29. A terminal, comprising: a display; a memory configured to storecomputer instructions and information of a voice assistant; and aprocessor coupled to the display and the memory and configured to:display, using the display and in response to a first operation, promptinformation, prompting a user to enter a to-be-recorded operation;receive, from the user, one or more operations; record, in response to asecond operation of the one or more operations, operation informationcorresponding to the one or more operations; store the operationinformation in the memory; determine, based on a third operation of theone or more operations, first text information corresponding to theoperation information, wherein the first text information comprises afirst part and a second part; receive a first voice command; and performa first corresponding operation based on the operation information whena first text corresponding to the first voice command matches the firsttext information, wherein the first text matches the first textinformation comprises: the first text is not the same as the first textinformation; and a first location relationship of a third part and afourth part in the first text is the same as a second locationrelationship between the first part and the second part, and whereineither the third part is different from the first part or the fourthpart is different from the second part.
 30. The terminal of claim 29,wherein the operation information comprises a first applicationidentifier, a first interface identifier, a first search word, andoperation indication information; wherein the first applicationidentifier is of an operation object application corresponding to theone or more operations, wherein the first interface identifier is of anoperation object interface corresponding to the one or more operations,wherein the operation indication information indicates an operationperformed in the operation object interface through the one or moreoperations, wherein the first part comprises the first applicationidentifier or the first interface identifier, and wherein the secondpart comprises the first search word.
 31. The terminal of claim 29,wherein the processor is further configured to: display, using thedisplay and in response to the first operation, the prompt informationin a first interface of the voice assistant; receive, from the user, afourth operation in the first interface; display, using the display andin response to the fourth operation, a second interface to enter, by theuser, the one or more operations; and receive, from the user, the one ormore operations in the second interface.
 32. The terminal of claim 30,wherein the processor is further configured to: display, using thedisplay and in response to the second operation, a third interfacebefore determining the first text information, wherein the thirdinterface comprises at least two pieces of text information, wherein theat least two pieces of text information are a statement formed byconnecting the first application identifier or the first interfaceidentifier and the first search word based on a preset locationrelationship using a connection word; receive, from the user, the thirdoperation on the first text information in the at least two pieces oftext information, wherein the third operation selects the first textinformation from the at least two pieces of text information; anddetermine, in response to the third operation, the first textinformation as second text information corresponding to the operationinformation.
 33. The terminal of claim 30, wherein the processor isfurther configured to: generate a first template text, by replacing thesecond part with type information of the first search word afterdetermining the first text information and before receiving the firstvoice command; and determine that the first text matches the first textinformation when the first text matches the first template text, whereinthe third part is the same as the first part, wherein the first locationrelationship is the same as the second location relationship, andwherein the fourth part is a word of a type indicated by the typeinformation.
 34. The terminal of claim 33, wherein after generating thefirst template text and before receiving the first voice command, theprocessor is further configured to display, using the display, a fourthinterface, prompting the user to send, through the voice assistant, thefirst voice command that matches the first template text to trigger theterminal to perform a second corresponding operation.
 35. The terminalof claim 34, wherein the processor is further configured to: display,using the display, a fifth interface, comprising an alias input boxbefore displaying the fourth interface, wherein the alias input boxreceives third text information, and wherein the third text informationis an alias for the first text information; receive the third textinformation from the user in the alias input box; display, using thedisplay, the third text information in the alias input box; receive,from the user, a fifth operation in the fifth interface, wherein thefifth operation triggers the terminal to end recording of textinformation; display, using the display to display, the fourthinterface; and store, in response to the fifth operation, the third textinformation and a correspondence between the third text information andthe operation information in the memory, wherein the fourth interfacefurther comprises the third text information.
 36. The terminal of claim35, wherein the processor is further configured to: receive, from theuser, a second voice command through the voice assistant; and perform,based on the correspondence, a sixth operation corresponding to theoperation information when a second text of the second voice command isthe same as the second text information.
 37. A computer program productcomprising computer-executable instructions stored on a non-transitorycomputer-readable storage medium that, when executed by a processor,cause a terminal to: display, in response to a first operation, a promptinformation prompting a user to enter a to-be-recorded operation;receive, from the user, one or more operations; record, in response to asecond operation of the one or more operations, operation informationcorresponding to the one or more operations; determine, based on a thirdoperation of the one or more operations, first text informationcorresponding to the operation information, wherein the first textinformation comprises a first part and a second part; receive a firstvoice command; and perform a first corresponding operation based on theoperation information when a first text corresponding to the first voicecommand matches the first text information, wherein the first textmatches the first text information comprises: the first text is not thesame as the first text information; and a first location relationship ofa third part and a fourth part in the first text is the same as a secondlocation relationship between the first part and the second part, andwherein either the third part is different from the first partes or thefourth part is different from the second part.
 38. The computer programproduct of claim 37, wherein the operation information comprises a firstapplication identifier, a first interface identifier, a first searchword, and operation indication information, wherein the firstapplication identifier is of an operation object applicationcorresponding to the one or more operations, wherein the first interfaceidentifier is of an operation object interface corresponding to the oneor more operations, wherein the operation indication informationindicates an operation performed in the operation object interfacethrough the one or more operations, wherein the first part comprises thefirst application identifier or the first interface identifier, andwherein the second part comprises the first search word.
 39. Thecomputer program product of claim 37, wherein the computer-executableinstructions further cause the terminal to: display, in response to theresponse to he first response to the first operation, the promtinformation in a first interface of a voice assistant; receive, from theuser, a fourth operation in the first interface; display, in response tothe fourth operation, a second interface to enter, by the user, the oneor more operations; and receive, from the user, the one or moreoperations in the second interface.
 40. The computer program product ofclaim 38, wherein before determining the first text information, thecomputer-executable instructions further cause the terminal to: display,in response to the second operation, a third interface comprising atleast two pieces of text information wherein the at least two pieces oftext information are a statement formed by connecting the firstapplication identifier or the first interface identifier and the firstsearch word based on a preset location relationship using a connectionword; receive, from the user, the third operation on the first textinformation in the at least two pieces of text information, wherein thethird operation selects the first text information from the at least twopieces of text information; and determine, in response to the thirdoperation, the first text information as second text informationcorresponding to the operation information.